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
(e-mail address removed)
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
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top