View Single Post
 
Old 08-22-2020, 01:46 PM
RedZed1100 RedZed1100 is offline Windows 10 Office 2016
Novice
 
Join Date: Aug 2020
Location: England
Posts: 8
RedZed1100 is on a distinguished road
Default

Thanks for the reply.

I'm doing it for my own amusement to see if it can be done - for which I created this very simple routine which kind of proves it can...

Sub BookmarkUpdate()
Dim BMRange As Range
'Identify current Bookmark range and insert text
For n = 1 To 4

Set BMRange = ActiveDocument.Bookmarks("MyBookmark").Range
If n = 1 Then
BMRange.Text = "First"
ElseIf n = 2 Then BMRange.Text = "Second"
ElseIf n = 3 Then BMRange.Text = "Third"
ElseIf n = 4 Then BMRange.Text = ""
End If

'Re-insert the bookmark
ActiveDocument.Bookmarks.Add "MyBookmark", BMRange

Next n
End Sub

This is more about me trying to understand VBA than actually achieving an end result - but thanks for the link - I don't know what any of it means so something else to learn ;-)
Reply With Quote