Convert working VBA macro into libre basic

47 Views Asked by At

I have a simple VBA macro for word that works fine. I searched the libre forum and also tried to find any documentation regarding the libre object model, I was not able to find anything that would help. I need to loop through each line (in VBA ActiveDocument.Paragraphs) and then evaluate and modify the text there. Could someone provide an example how to iterate through the lines of text in libre office writer in a BASIC sub? 2. If possible, it would also be great is someone knew how to insert text at the end of the document similar to VBA:

ActiveDocument.Paragraphs.Add
ActiveDocument.Content.InsertAfter Text:=strEnd
1

There are 1 best solutions below

1
JohnSUN On

For the subroutine for enumerating paragraphs (paragraphs, not lines!) see "7.16.3.What does it mean to enumerate text content?", and for adding text - in "7.6. Insert text" and "7.6.1. Insert new paragraph"

(When viewing listings in other chapters, pay attention to the repeated line of code oCursor.gotoEnd(false) )