I'm trying to run a macro into Writer/web, so the document is in HTML SOURCE mode.
There I can write/edit html just fine but using my macro i can't insert text. This macro worked fine in Writer NORMAL MODE.
So my function simplified it's:
Code: Select all
sub p_text( dTxt as String)
dim oCursor,vCursor as object
REM these lines show ->error getViewCuror not found
' vCursor = ThisComponent.CurrentController.getViewCursor()
' vCursor.getText.insertString(vCursor.getStart(), dTxt & CHR$(13), False)
REM These pass without error but doesnt write anything
REM but i don't know if this text cursor is able to insert text without an specific anchor
oCursor = thisComponent.getText.createTextCursor
oCursor.getText.insertString(oCursor.getStart(), dTxt , False)
end Sub
Many thanks