Hi,
I am trying to set up a structured document in Word2000, consisting of many sections, each containing various information that can change at the users command from an external VB6 program (reporting system).
In order to be able to move sections and to access the elements of a section (legend, comment, figures, etc.) I add bookmarks to the document for all sections (and subsection) which then get filled with the information.
However, when I select a bookmark's full range and then change the text or whatever to something else with the code below, the text is changed, but afterwards the bookmark is gone.
Set CurrRange = CurrDoc.Bookmarks("BookName".Range
CurrRange.Text = "Something else..."
... Bookmark gone
The only way I seem to be able to save the bookmark from being deleted when changing its content is to leave one character at the end deselected when building the range.
Set CurrRange = CurrDocument.Range(Start:=CurrDocument.Bookmarks("BookName".Range.Start, End:=CurrDocument.Bookmarks("BookName".Range.End - 1)
This means always having one extra character at the end of the bookmark - and I simply can not imagine that this should be the only way to preserve the bookmarks throughout changes of their content.
Can anyone help???
TIA,
Ingmar
I am trying to set up a structured document in Word2000, consisting of many sections, each containing various information that can change at the users command from an external VB6 program (reporting system).
In order to be able to move sections and to access the elements of a section (legend, comment, figures, etc.) I add bookmarks to the document for all sections (and subsection) which then get filled with the information.
However, when I select a bookmark's full range and then change the text or whatever to something else with the code below, the text is changed, but afterwards the bookmark is gone.
Set CurrRange = CurrDoc.Bookmarks("BookName".Range
CurrRange.Text = "Something else..."
... Bookmark gone
The only way I seem to be able to save the bookmark from being deleted when changing its content is to leave one character at the end deselected when building the range.
Set CurrRange = CurrDocument.Range(Start:=CurrDocument.Bookmarks("BookName".Range.Start, End:=CurrDocument.Bookmarks("BookName".Range.End - 1)
This means always having one extra character at the end of the bookmark - and I simply can not imagine that this should be the only way to preserve the bookmarks throughout changes of their content.
Can anyone help???
TIA,
Ingmar