Hi all, I’m new to LibreOffice Basic: many thanks in advance for your help!
In VBA I am able to search for all instances of a search string in a document, and insert a comment bubble on (or alternatively a footnote after) each such instance, e.g. inserting a comment “Hello World” on each instance of “Hello” in a document using this simple code:
Sub HelloWorld()
Dim range As range
Set range = ActiveDocument.Content
Do While range.Find.Execute(“Hello”, False) = True
ActiveDocument.Comments.Add range, “Hello World”
Loop
End Sub
I see that LibreOffice Basic supports Do Loops, and I also like that (unlike VBA) LibreOffice Basic appears to support search strings using characters outside ASCII. However my attempts to reproduce a similar macro in LibreOffice Basic to the above VBA code (so that it works in LibreOffice Writer) have failed. Any help from the experts on this forum would be greatly appreciated, thanks!