I am trying to make a macro for LibreOffice Writer so that when I press an assigned function key on the keyboard, the macro runs and appends text to my document. This following code snippet is what I have manage to find after scouring the web:
sub file_io_write
Dim filename As String
Dim num As Integer
filename = "/tmp/Untitled.odt"
num = FreeFile()
open filename for output as #num
write #num, "col1", "col2", "col3"
write #num, "1", "2", "3"
write #num, "4", "5", "6"
close #num
msgbox "Done"
end sub
The only problem here is that the text doesn’t update in real time, I have to reload the document manually in order to view the text. Is there a function that will allow bypassing the required action of manually reloading the document? I’m fine with quick and dirty methods such as simply reloading the document from file. Thank you for your time.