![]() |
|
#3
|
|||
|
|||
|
Quote:
To show where's each bookmark/name in a document, I use this code: Code:
Sub HighlightBookmarks()
Dim objBookmark As Bookmark, objDoc As Document
Application.ScreenUpdating = False
Set objDoc = ActiveDocument
With objDoc
For Each objBookmark In .Bookmarks
With objBookmark.Range
.Text = "[ " & objBookmark.Name & " ]"
.HighlightColorIndex = wdBrightGreen
End With
Next objBookmark
End With
Application.ScreenUpdating = True
End Sub
It is simple to reproduce the problem, insert a bookmark at the beginning of a document, type some text, insert another bookmark, run the macros, go to the list of bookmarks and see that the first bookmark is gone. Thanks |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Formatting text within brackets
|
jimmi6jjr | Word | 4 | 10-04-2022 09:33 PM |
find and delet all text within brackets and the brackets themselves
|
wrdy | Word | 2 | 08-03-2017 06:55 PM |
Word 2003 Brackets appear around copied text
|
barrage | Word | 1 | 12-16-2015 02:59 PM |
| Microsoft Word macro to find text, select all text between brackets, and delete | helal1990 | Word VBA | 4 | 02-05-2015 03:52 PM |
Form updating Bookmarks - writes to the bookmarks multiple times
|
PeterPlys | Word VBA | 13 | 01-14-2015 06:41 AM |