I have nested bookmarks in a document (for example [xxxxx[yyyyyy]xxxxx]).

Is it possible using Word VBA to identify if the cursor is in the "yyyyy"
bookmark instead of the "xxxxx" bookmark? When I use
"Selection.Bookmarks(1).Select", I always get the larger of the two bookmarks
returned.

Many thanks.

Re: Bookmark Selection Question by macropod

macropod
Fri Jun 02 18:13:08 CDT 2006

Hi Magic Man,

Try something like:
Sub GetBookmarkNames()
Dim Bkmrk As Bookmark
For Each Bkmrk In Selection.Bookmarks
MsgBox Bkmrk.Name
Next
End Sub

Cheers

--
macropod
[MVP - Microsoft Word]


"Magic Man" <MagicMan@discussions.microsoft.com> wrote in message
news:ADD9F052-9838-4B83-9501-E70177B8CD23@microsoft.com...
> I have nested bookmarks in a document (for example [xxxxx[yyyyyy]xxxxx]).
>
> Is it possible using Word VBA to identify if the cursor is in the "yyyyy"
> bookmark instead of the "xxxxx" bookmark? When I use
> "Selection.Bookmarks(1).Select", I always get the larger of the two
bookmarks
> returned.
>
> Many thanks.



Re: Bookmark Selection Question by Helmut

Helmut
Sat Jun 03 02:32:12 CDT 2006

Hi Magic Man,

try this one:

With Selection.Bookmarks
MsgBox .Item(.Count).Name
.Item(.Count).Select
End With

--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"