Select item from formulary

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
briglia23
Posts: 155
Joined: Tue Jun 24, 2008 10:09 am

Select item from formulary

Post by briglia23 »

Hi all.
How can i select a value from item in a formulary.

I have a primary and a secondary formulari i want select a text from a text label of secondary formulary.

i try this

Code: Select all

Sub Main
Dim oDoc as Object
Dim Form as Object
Dim PrefissoWin as String
PrefissoWin = "D:\\"
oDoc = ThisComponent
DrawPage = oDoc.DrawPage
Form = DrawPage.Forms.GetByIndex(0)
'xray Form
'path = oDoc.getUrl()
FormPath = Form.hasByName("path")
'print FormPath
FormPath = Form.getByName("path")
'xray FormPath
PathCertificato = FormPath.text()
'print PathCertificato
NomeCertificato=Right(PathCertificato,42)
NomeCertificato=ConvertFromUrl(NomeCertificato)
'print NomeCertificato

PathWin= PrefissoWin & NomeCertificato
'print PathWin
Url="/utenti/brigliadori/corso_BASIC.pdf"
sDestUrl = ConvertToUrl(URL)
oSys = CreateUnoService("com.sun.star.system.SystemShellExecute")
oSys.execute(sDestUrl, "", 0)
End Sub
but the macro don't find the "path" text label.
Thanks
OOo 2.3.X on openSuse 10
Post Reply