Bookmark in a Text Box

S

Steven

Hi all

I am trying to goto a bookmark in a word doc via code, but because its in a
Text Box, it doesnt seem to like it.
I get error msg 5678

What i want to do is goto the bookmark called DelHere and then delete it so
the line moves up one.

I know the code works on bookmarks outside the text box as i have moved it
and works fine.

Any ideas??

The code i am trying to use looks like this

Selection.Goto What:=wdGoToBookmark, Name:="DelHere"
Selection.TypeBackspace


Thanks
 
J

Jezebel

Activedocument.Bookmarks("DelHere").Range.Delete

At least, I assume that's what you intend: delete not just the Bookmark but
the Bookmark CONTENT. You can delete the bookmark itself --

Activedocument.Bookmarks("DelHere").Delete

which removes the bookmark from the collection, without affecting the
document content.
 

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