T
TT
I am really becoming confused when it comes to navigating bookmarks. I have
no problem when I reference bookmarks by name, but I run into problems
whenever I try to vavigate based on wdGotoNext, wdGotoAbsolute, wdGotoFirst,
etc. I have a document with 3 bookmarks (the msgbox confirms this when I run
the macro below). However, the code below always returns "The bookmark does
not exist". when it hits the .Goto. What am I missing?
Public Sub macro2()
Dim rng As Range
MsgBox ActiveDocument.Range.Bookmarks.Count
Set rng = ActiveDocument.Range.GoTo(wdGoToBookmark, wdGoToAbsolute, 2)
End Sub
no problem when I reference bookmarks by name, but I run into problems
whenever I try to vavigate based on wdGotoNext, wdGotoAbsolute, wdGotoFirst,
etc. I have a document with 3 bookmarks (the msgbox confirms this when I run
the macro below). However, the code below always returns "The bookmark does
not exist". when it hits the .Goto. What am I missing?
Public Sub macro2()
Dim rng As Range
MsgBox ActiveDocument.Range.Bookmarks.Count
Set rng = ActiveDocument.Range.GoTo(wdGoToBookmark, wdGoToAbsolute, 2)
End Sub