Can you have multiple bookmarks in one macro? Newbie

J

Jeanne Moos

I have four bookmarks temp, file, title, appno in a template

Is there any way I can place all four bookmarks in one macro or do I have to
create 4 separate macros for each bookmark?
My bookmark below works great but I would like to place them in one macro.
Is this possible? If yes, what is the syntax.

Sub Bookmarks()
ActiveDocument.Bookmarks("filenb").Select
End Sub

Thanks
 
J

Jezebel

You can place any number of bookmarks in there, but you can't select more
than one at a time. What are you actually trying to do?
 
J

Jeanne Moos

I think you answered my question. I need to create four separate subs for
each bookmark.
Like this

Sub Bookmarks()I'm trying to retrieve a bookmark.
Thanks
 
D

Doug Robbins

It is not really clear what you are doing, but if you want to retrieve the
text that is in the bookmark, it is better to use the Range object.

Dim abm As Bookmark
For Each abm In ActiveDocument.Bookmarks
MsgBox abm.Range.Text
Next abm


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
J

Jeanne Moos

Thanks both replies answered by question. :)

Jeanne Moos said:
I think you answered my question. I need to create four separate subs for
each bookmark.
Like this

Sub Bookmarks()
I'm trying to retrieve a bookmark.
Thanks
 
Top