bookmarks save & restore

T

ted medin

We would like to save & delete any bookmarks at the start of the procedure &
then @ the end of the procedure restore those deleted bookmarks. Tried a few
things but no banana. HELP!
 
J

Jezebel

You can iterate the bookmarks and record the start and end point of each;
then on completion of your procedure create bookmarks for each of those
start and end point pairs. That will work if your procedure doesn't make any
changes to the body of the document; but if that's the case is there
wouldn't be any point in deleting and recreating the bookmarks.

Forget the method for the moment ... what are you actually trying to do?
 
T

ted medin

Forget the method for the moment ... what are you actually trying to do?

Have template which we insert & then fill the bookmarks of the template. If
the doc already has a bookmark with the same name as the templates the doc
gets all screwed up :-(. So would like to remember the bookmarks on entry
then delete them and recover them when the proceedure exits.
 
J

Jezebel

A better approach for this is to use CustomDocumentProperties. Put
DocProperty fields in the document where you need the inserted data to
appear; then in your code set the property values. Much more reliable, saves
your code have to muck around with the body of the document, and you
completely side-step problems like the one you're currently trying to deal
with.
 
T

ted medin

Jezebel said:
A better approach for this is to use CustomDocumentProperties. Put
DocProperty fields in the document where you need the inserted data to
appear; then in your code set the property values. Much more reliable, saves
your code have to muck around with the body of the document, and you
completely side-step problems like the one you're currently trying to deal
with.

Sorry working with objects quickly overwhelms me :-(. You did point out that
the bookmarks on entry may be changed when my bookmarks are inserted. So my
solution is to delete all bookmarks @ the start. Will work for my specifics
but not a general solution like you suggested above. THANKS!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top