Thanks for your answer.
I explain better as I can: I open a calc document, I read the first
record, where there are the header, then I open a writer document, and I
should open a non-modal(?) dialog, where I ask the user: "Put the cursor
where you want the first header", with a ok button to push when he has
positioned the cursor, and so on to the last header. (The user can also
modify the writer document, in the meanwhile).
There will be string and value data in the calc document.
Andrew Douglas Pitonyak ha scritto:
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]