J
Jim Dahlstrom
Thanks to any that respond.
Using Word 2002.
In automating the development of documents (i.e.
procurement specifications) a routine has been developed
that allows the "author" to identify (mark) certain
phrases using bookmarks for later reference.
A routine is needed that will load a variable with
the .Name of the bookmark the user's cursor is within.
The following code returns an incorrect result:
BNo = Selection.BookmarkID
Bname = Selection.Bookmarks(BNo).Name
I am certain that the cursor is between the boundaries of
a bookmark. The returned BNo is the ID of a bookmark that
is 10 pages away from the cursor position and Bname indeed
returns the name of that bookmark.
My feeling is that a .Range definition is needed, but have
tried multiple variations (using the VBA help attached to
the Office 2000) without success.
What code can produce the appropriate >Name?
Using Word 2002.
In automating the development of documents (i.e.
procurement specifications) a routine has been developed
that allows the "author" to identify (mark) certain
phrases using bookmarks for later reference.
A routine is needed that will load a variable with
the .Name of the bookmark the user's cursor is within.
The following code returns an incorrect result:
BNo = Selection.BookmarkID
Bname = Selection.Bookmarks(BNo).Name
I am certain that the cursor is between the boundaries of
a bookmark. The returned BNo is the ID of a bookmark that
is 10 pages away from the cursor position and Bname indeed
returns the name of that bookmark.
My feeling is that a .Range definition is needed, but have
tried multiple variations (using the VBA help attached to
the Office 2000) without success.
What code can produce the appropriate >Name?