Select item from formulary

Creating a macro - Writing a Script - Using the API

Select item from formulary

Postby briglia23 » Mon Aug 04, 2008 12:52 pm

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   Expand viewCollapse view
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
briglia23
 
Posts: 155
Joined: Tue Jun 24, 2008 10:09 am

Return to Macros and UNO API

Who is online

Users browsing this forum: No registered users and 8 guests