What type of data file do you want to open?

What kind of data do you want to read?

How do you know where to put the data?


sergio wrote:
I have a script in StarBasic that find some data, then open a file and should wait for the user's input (move the cursor to the desired destination of the data), then write the data.
I don't have idea on how to do this.
I append the macro.
Thanks in advance.
Sergio

REM  *****  BASIC  *****
Dim vData as Variant
Dim Ccount as Integer
Sub Main
oCalc = ThisComponent
StarDesktop.loadComponentFromUrl(UrlFile,"_blank",0,array())
DataFinder(oCalc,1)
for l = 0 to Ccount
   MsgBox ("Place the cursor where will be the " & vData(l) )
next

End Sub

Function UrlFile
oFilePicker = createUnoService ("com.sun.star.ui.dialogs.FilePicker")
oFilePicker.execute
Url = oFilePicker.getSelectedFiles
UrlFile = Url(0)
End Function

Function DataFinder(oCalc, Optional Row)
oSel = oCalc.CurrentSelection
if Row then
   Rcount = Row-1
else
   Rcount = oSel.rows.count-1
endif
Ccount = oSel.columns.count-1
aData = oSel.getDataArray
for i = 0 to Rcount
   vData = aData(i)
next
End Function

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


--
Andrew Pitonyak
My Macro Document: http://www.pitonyak.org/AndrewMacro.odt
My Book: http://www.hentzenwerke.com/catalog/oome.htm
Info:  http://www.pitonyak.org/oo.php
See Also: http://documentation.openoffice.org/HOW_TO/index.html


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to