Word 2000 and Bookmarks

L

L.A. Lawyer

I want to replace the text in a bookmark without deleting the bookmark
itself. How is that done?
 
J

Jean-Guy Marcil

L.A. Lawyer was telling us:
L.A. Lawyer nous racontait que :
I want to replace the text in a bookmark without deleting the bookmark
itself. How is that done?

Like this:

Dim bkMarkName As String
Dim bkMarkRge As Range

bkMarkName = "Test"

Set bkMarkRge = ActiveDocument.Bookmarks(bkMarkName).Range
bkMarkRge.Text = "New Short Text"
ActiveDocument.Bookmarks.Add bkMarkName, bkMarkRge

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
[email protected]
Word MVP site: http://www.word.mvps.org
 
L

L.A. Lawyer

Merci, mon ami!


Jean-Guy Marcil said:
L.A. Lawyer was telling us:
L.A. Lawyer nous racontait que :


Like this:

Dim bkMarkName As String
Dim bkMarkRge As Range

bkMarkName = "Test"

Set bkMarkRge = ActiveDocument.Bookmarks(bkMarkName).Range
bkMarkRge.Text = "New Short Text"
ActiveDocument.Bookmarks.Add bkMarkName, bkMarkRge

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
[email protected]
Word MVP site: http://www.word.mvps.org
 
Top