Date: prev next · Thread: first prev next last
2015 Archives by date, by thread · List index


Dear list,
 I am trying to update the text contained in a bookmark using a basic macro. It works great when I 
make a selection in the ui and insert a bookmark. This way the content is always replaced just as I 
would like. Trouble is when I position the cursor and then insert a bookmark. Now when I use the 
macro the text is always inserted at the position of the bookmark and never replaced. I cannot seem 
to figure out how to fix this.
 This is the macro I use:
 Dim Doc As Object
Dim Bookmark As Object
Dim Cursor As Object
 Doc = ThisComponent
 Bookmark = Doc.Bookmarks.getByName("bm1")
 Cursor = Doc.Text.createTextCursorByRange(Bookmark.Anchor)
 Cursor.String = "-- bookmark1 --"
 Thanks a lot for you support!
 - Koos

 

-- 
To unsubscribe e-mail to: users+unsubscribe@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.