Macro OpenOffice Writer: next record

44 Views Asked by At

I'm literally going crazy to create a simple macro in writer. How do I get the number of all records of the selected query and move to the next record?

Below a piece of code.

odoc=thiscomponent
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
oVCur = oDoc.getCurrentController.getViewCursor 'ViewCursor für aktuelle Cursorposition holen
oField = oDoc.createInstance("com.sun.star.text.textfield.DatabaseNextSet")

With oField
    .Condition = "TRUE"
    .DataBaseName = NameSource 'database name
    .DataTableName = nameTable 'query name
    .DataCommandType = 1 '0 =table; 1=query
End With

'Line to go to next database record? '<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
'Line to count all database record? '<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
0

There are 0 best solutions below