View Single Post
  #8   Report Post  
Posted to microsoft.public.word.newusers
Bear[_2_] Bear[_2_] is offline
external usenet poster
 
Posts: 314
Default need field to remove the first word in a cross reference

Brian:

You should just replace Word's Cross-Reference command with your own. (Just
kidding. I did, but it's not trivial. But oh, so satisfying.)

Anyway... Can't you get the range of the bookmark and find the first or
second bookmark with it (that's your bookmark). Maybe easier if you use a
fixed prefix for your bookmarks. The following is pseudo-code to illustrate
the idea.

Dim objRange as Range
Dim strBookmark as String
Dim objBookmark as Bookmark

' Insert code to determine the name of Word's bookmark
' and save it in strBookmark

set objRange = Activedocument.Bookmarks(strBookmark)
For each objBookmark in objRange.Bookmarks
If Left(objBookmark.Name, 3) = "BXM" Then
' Your processing here
End If
Next objBookmark

~~~~~

This doesn't have any error handling or anything, but I hope you get the idea.

Bear

--
Windows XP, Word 2000