M
Martin
Hi,
I have a long document with numerous bookmarks. I
populate a listbox, from the control toolbox, with the
names of the bookmarks. I want to go the selected
bookmark - and can't quite figure out how to do it. Any
help is greatly appreciated.
TIA
Martin
Here is code
Private Sub Document_Open()
Dim i As Integer
i = Documents("III Audit Cases").Bookmarks.Count
On Error Resume Next
For i = 1 To Documents("III Audit Cases").Bookmarks.Count
On Error GoTo 0
With ListBox1
..AddItem Documents("III Audit Cases").Bookmarks(i).Name
End With
Next i
End Sub
Private Sub ListBox1_Click()
Dim i As Integer
Dim myselection As String
myselection = ListBox1.List(i)
Selection.GoTo What:=wdGoToBookmark, Name:=myselection
End Sub
I have a long document with numerous bookmarks. I
populate a listbox, from the control toolbox, with the
names of the bookmarks. I want to go the selected
bookmark - and can't quite figure out how to do it. Any
help is greatly appreciated.
TIA
Martin
Here is code
Private Sub Document_Open()
Dim i As Integer
i = Documents("III Audit Cases").Bookmarks.Count
On Error Resume Next
For i = 1 To Documents("III Audit Cases").Bookmarks.Count
On Error GoTo 0
With ListBox1
..AddItem Documents("III Audit Cases").Bookmarks(i).Name
End With
Next i
End Sub
Private Sub ListBox1_Click()
Dim i As Integer
Dim myselection As String
myselection = ListBox1.List(i)
Selection.GoTo What:=wdGoToBookmark, Name:=myselection
End Sub