Augest
10-16-2008, 04:08 PM
Trying to create an utility similar to the Bookmark built in MS Word.
Im trying to count the bookmarks already created within the text.
Then to show them in a textbox within an userform by inputting their index number.
So it would hightlight them within the document, and also have a copy of it in the text box.
Example codes for counting and locating the bookmark using the index (not the bookmark name) would be great.
strbookmark = ActiveDocument.Bookmarks("Bookmark5").Range.Text
TextBox1.Value = strbookmark This code shows the specific bookmark in the textbox but doesn't highlight them in the document
Selection.GoTo What:=wdGoToBookmark, Name:=ActiveDocument.Bookmarks(1).Name This code highlights the bookmark within the document but doesn't show the bookmark in the textbox.
Need a code that does both of these jobs.
There are millions more questions but i would like to solve these ones first.
Im trying to count the bookmarks already created within the text.
Then to show them in a textbox within an userform by inputting their index number.
So it would hightlight them within the document, and also have a copy of it in the text box.
Example codes for counting and locating the bookmark using the index (not the bookmark name) would be great.
strbookmark = ActiveDocument.Bookmarks("Bookmark5").Range.Text
TextBox1.Value = strbookmark This code shows the specific bookmark in the textbox but doesn't highlight them in the document
Selection.GoTo What:=wdGoToBookmark, Name:=ActiveDocument.Bookmarks(1).Name This code highlights the bookmark within the document but doesn't show the bookmark in the textbox.
Need a code that does both of these jobs.
There are millions more questions but i would like to solve these ones first.