Code to locate bookmark in footer

R

Ruth

I have inserted a field in the footer of a document and
assigned a bookmark to it in order to remove the field. I
am having a problem writing the code to find the bookmark
called "documentpath" in the footer and delete it. Can
someone help me out? Thanks!
 
S

Stephanie Krieger

Hi, Ruth,

Doesn't matter that it's in the footer if you've assigned
a bookmark to it. If the field is contained within the
bookmark (i.e., you had the field selected when you
created the bookmark) -- it's just one line of code to
delete the bookmark and its contents, wherever that
bookmark appears in the document.

ActiveDocument.Bookmarks("documentpath").Range.Delete

Hope that helps.

Best,
Stephanie Krieger
author of Microsoft Office Document Designer (from
Microsoft Learning)
email: MODD_2003 at msn dot com
blog: arouet.net
 

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