![]() |
#6
|
||||
|
||||
![]()
The problem isn't with anything that Graham or I posted but with the the wrong kind of loop being used in your own code. Try:
Code:
Sub UpdateBookmarks() Dim i As Long With ActiveDocument For i = 1 To .Bookmarks.Count With .Bookmarks(i) Call UpdateBM(.Name, InputBox("Please enter " & .Name)) End With Next End With End Sub Sub UpdateBM(bmName As String, bmContent As String) Dim bmRng As Word.Range With ActiveDocument Set bmRng = .Bookmarks(bmName).Range bmRng.Text = bmContent .Bookmarks.Add bmName, bmRng End With End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
CCITE140 | Excel | 1 | 11-30-2015 07:42 AM |
Replacing the 2nd or 3rd instance of Text | wdillon2 | Word VBA | 2 | 05-13-2015 10:21 PM |
![]() |
piritzo | Word | 2 | 06-22-2013 12:50 AM |
![]() |
sbatson5 | Word | 2 | 04-13-2012 03:49 AM |
Replacing / editting text | LisaC | Word | 0 | 02-25-2010 03:40 AM |