Put the following macro in the same folder as Greg's macro, then instead of using (say)
call the macro e.g..Bookmarks.Add "wholename", oRng
Repeat for each named bookmark. If the target bookmark doesn't exist it is simply ignored.FillBM oTarDoc, "wholename", oRng
Private Sub FillBM(oDoc as Document, strBMName As String, strValue As String) Dim oRng As Range With oDoc On Error GoTo lbl_Exit Set oRng = .Bookmarks(strBMName).Range oRng.Text = strValue oRng.Bookmarks.Add strBMName End With lbl_Exit: Set oRng = Nothing Exit Sub End Sub




Reply With Quote
