![]() |
|
#4
|
||||
|
||||
|
The proper way to update bookmark content is to add the content to the bookmark, not after it. Use code like:
Code:
Sub UpdateBookmark (wdDoc as Document, BmkNm as string, NewTxt as string)
Dim BmkRng as Word.Range
With wdDoc
If.Bookmarks.Exists(BmkNm) Then
Set BmkRng =.Bookmarks(BmkNm).Range
BmkRng.Text = NewTxt
.Bookmarks.Add BmkNm, BmkRng
End if
End With
Set BmkRng = Nothing
End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Word VBA: Cannot Edit Range (Delete characters except the first in a table cell)
|
tinfanide | Word VBA | 3 | 04-27-2012 09:48 AM |
delete all bookmark text
|
hklein | Word VBA | 4 | 08-10-2011 04:33 AM |
| Can't delete range - error 5904 | expatriate | Word VBA | 1 | 06-03-2011 12:12 AM |
Newbie: Delete Bookmark
|
expatriate | Word VBA | 4 | 06-02-2011 01:12 AM |
| delete email message via blackberry and have it delete on my pop3 and my outlook | Iamthestorm | Outlook | 2 | 10-28-2010 12:21 AM |