- Code: Select all Expand viewCollapse view
If Accident = True Then
NormalTemplate.AutoTextEntries("Accident merit").Insert _
Where:=ActiveDocument.Bookmarks("merit").Range, RichText:=True
NormalTemplate.AutoTextEntries("medical expert's fees").Insert _
Where:=ActiveDocument.Bookmarks("expertFees").Range, RichText:=True
End If
I have searched all around but haven't yet found out how to do so in LibreOffice. I know it has something to do with the service com.sun.star.text.XAutoTextEntry or XText, but I haven't figured out the actual code that will insert the AutoText in the document. Ideally, I'd like to replace some markup text such as "<merit>" with the AutoText entry instead of using Bookmarks as I did in MS VBA, because otherwise I'd also have to delete all Bookmarks afterwards, and that's something else I haven't figured out how to do as well...