Code to Delete Bookmarks

R

Ron

I am populating bookmarks from an Access modules, but on occasion a variable
is null, when this happens I would like to delete the associated bookmark.
Can I delete the bookmark from Access, or do I have to delete it from Word?
How do I delete it?

Doug, thanks fror your previous answer.
 
J

Jonathan West

Ron said:
I am populating bookmarks from an Access modules, but on occasion a
variable
is null, when this happens I would like to delete the associated bookmark.
Can I delete the bookmark from Access, or do I have to delete it from
Word?
How do I delete it?

If the code is runnin gfrom within Access, you will need something like this

objWord.ActiveDocument.Bookmarks("ThisBookmark").Delete
 

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