![]() |
|
#5
|
||||
|
||||
|
You don't need to loop through bookmarks to see if it exists
Code:
Sub TestBookmark()
Dim oBM As Bookmark
If ActiveDocument.Bookmarks.Exists("code") Then
Set oBM = ActiveDocument.Bookmarks("code")
MsgBox oBM.Range.Text
Else
MsgBox "This bookmark doesn't exist" & vbCr & "code"
End If
End Sub
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Can't save Word 2019 doc to original folder - can you help please? | frustratedphil | Word | 1 | 01-06-2019 11:11 AM |
Save all docs to pdf in specified folder
|
loki005 | Word VBA | 4 | 10-25-2018 02:18 PM |
| macro to save as pdf with name from bookmark | pamtupac | Word VBA | 3 | 06-06-2017 08:23 PM |
Macro to save as pdf with ability to choose save as folder
|
rvessio | Word VBA | 4 | 07-25-2016 12:37 PM |
Default Save AS File Name from Bookmark
|
xscotsmanx | Word VBA | 1 | 07-17-2011 12:23 AM |