Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
bookmarks
I am using Word 2000 & I seem to have 1000's of hidden bookmarks. How can I
get rid of them, besides using the bookmark dialog box which deletes them one by one? I do have about 60 that I would like to keep if possible, but would sacrifice them if need be to get rid of the 1000's. -- Later, -- Richard -- |
#2
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
bookmarks
Hi Richard,
Getting rid of them is easy enough with a macro, but be careful - Word may actually be using them. For example, if your document has cross-references to headings, you'll likely have bookmarks prefixed with '_Ref'. Delete those and your cross-references are history. To see what all these bookmarks are and what they refer to, run the following code. It will produce a listing at the end of the document: Sub ListBkMrks() Dim oBkMrk As Bookmark, oBmk As Variant ActiveDocument.Bookmarks.ShowHidden = True If ActiveDocument.Bookmarks.Count 0 Then For Each oBkMrk In ActiveDocument.Bookmarks With Selection .EndKey Unit:=wdStory .InsertAfter vbCrLf .InsertAfter oBkMrk.Name & " " .EndKey Unit:=wdStory oBmk = ActiveDocument.Fields.Add(Range:=Selection.Range, _ Text:=oBkMrk.Name, PreserveFormatting:=False) End With Next oBkMrk End If End Sub After you've run this, you can see which ones might not be needed. You can probably safely kill off any empty bookmarks, for which you can use the following code: Sub KillEmptyBkMrks() Dim oBkMrk As Bookmark, oBmk As Variant ActiveDocument.Bookmarks.ShowHidden = True If ActiveDocument.Bookmarks.Count 0 Then For Each oBkMrk In ActiveDocument.Bookmarks If ActiveDocument.Bookmarks(oBkMrk).Empty = True Then oBkMrk.Delete Next oBkMrk End If End Sub If you then re-run the 'ListBkMrks' macro, the listing may be significantly shorter. Any other unwanted bookmarks are best deleted manually. Cheers -- macropod [MVP - Microsoft Word] "Richard" wrote in message ... I am using Word 2000 & I seem to have 1000's of hidden bookmarks. How can I get rid of them, besides using the bookmark dialog box which deletes them one by one? I do have about 60 that I would like to keep if possible, but would sacrifice them if need be to get rid of the 1000's. -- Later, -- Richard -- |
#3
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
bookmarks
Your macro's were a great help!
What about duplicate bk marks? How can I delete those? Thanks, Richard "macropod" wrote in message ... Hi Richard, Getting rid of them is easy enough with a macro, but be careful - Word may actually be using them. For example, if your document has cross-references to headings, you'll likely have bookmarks prefixed with '_Ref'. Delete those and your cross-references are history. To see what all these bookmarks are and what they refer to, run the following code. It will produce a listing at the end of the document: Sub ListBkMrks() Dim oBkMrk As Bookmark, oBmk As Variant ActiveDocument.Bookmarks.ShowHidden = True If ActiveDocument.Bookmarks.Count 0 Then For Each oBkMrk In ActiveDocument.Bookmarks With Selection .EndKey Unit:=wdStory .InsertAfter vbCrLf .InsertAfter oBkMrk.Name & " " .EndKey Unit:=wdStory oBmk = ActiveDocument.Fields.Add(Range:=Selection.Range, _ Text:=oBkMrk.Name, PreserveFormatting:=False) End With Next oBkMrk End If End Sub After you've run this, you can see which ones might not be needed. You can probably safely kill off any empty bookmarks, for which you can use the following code: Sub KillEmptyBkMrks() Dim oBkMrk As Bookmark, oBmk As Variant ActiveDocument.Bookmarks.ShowHidden = True If ActiveDocument.Bookmarks.Count 0 Then For Each oBkMrk In ActiveDocument.Bookmarks If ActiveDocument.Bookmarks(oBkMrk).Empty = True Then oBkMrk.Delete Next oBkMrk End If End Sub If you then re-run the 'ListBkMrks' macro, the listing may be significantly shorter. Any other unwanted bookmarks are best deleted manually. Cheers -- macropod [MVP - Microsoft Word] "Richard" wrote in message ... I am using Word 2000 & I seem to have 1000's of hidden bookmarks. How can I get rid of them, besides using the bookmark dialog box which deletes them one by one? I do have about 60 that I would like to keep if possible, but would sacrifice them if need be to get rid of the 1000's. -- Later, -- Richard -- |
#4
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
bookmarks
Hi Richard,
Duplicate bookmarks could only exist if the same string was given more than one bookmark. There may have been a good reason for that. If your document has any, they'll be found by the ListBkMrks macro. You'll need to decide which ones to keep/discard. Cheers -- macropod [MVP - Microsoft Word] "Richard" wrote in message ... Your macro's were a great help! What about duplicate bk marks? How can I delete those? Thanks, Richard "macropod" wrote in message ... Hi Richard, Getting rid of them is easy enough with a macro, but be careful - Word may actually be using them. For example, if your document has cross-references to headings, you'll likely have bookmarks prefixed with '_Ref'. Delete those and your cross-references are history. To see what all these bookmarks are and what they refer to, run the following code. It will produce a listing at the end of the document: Sub ListBkMrks() Dim oBkMrk As Bookmark, oBmk As Variant ActiveDocument.Bookmarks.ShowHidden = True If ActiveDocument.Bookmarks.Count 0 Then For Each oBkMrk In ActiveDocument.Bookmarks With Selection .EndKey Unit:=wdStory .InsertAfter vbCrLf .InsertAfter oBkMrk.Name & " " .EndKey Unit:=wdStory oBmk = ActiveDocument.Fields.Add(Range:=Selection.Range, _ Text:=oBkMrk.Name, PreserveFormatting:=False) End With Next oBkMrk End If End Sub After you've run this, you can see which ones might not be needed. You can probably safely kill off any empty bookmarks, for which you can use the following code: Sub KillEmptyBkMrks() Dim oBkMrk As Bookmark, oBmk As Variant ActiveDocument.Bookmarks.ShowHidden = True If ActiveDocument.Bookmarks.Count 0 Then For Each oBkMrk In ActiveDocument.Bookmarks If ActiveDocument.Bookmarks(oBkMrk).Empty = True Then oBkMrk.Delete Next oBkMrk End If End Sub If you then re-run the 'ListBkMrks' macro, the listing may be significantly shorter. Any other unwanted bookmarks are best deleted manually. Cheers -- macropod [MVP - Microsoft Word] "Richard" wrote in message ... I am using Word 2000 & I seem to have 1000's of hidden bookmarks. How can I get rid of them, besides using the bookmark dialog box which deletes them one by one? I do have about 60 that I would like to keep if possible, but would sacrifice them if need be to get rid of the 1000's. -- Later, -- Richard -- |
#5
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
bookmarks
I looked at the list & it has 100's that I don't need?
It also seems to repeat the text that is in the bk mrk? It is impossible to go to every bkmrk to see whether it is needed or not? Any ideas? Richard "macropod" wrote in message ... Hi Richard, Duplicate bookmarks could only exist if the same string was given more than one bookmark. There may have been a good reason for that. If your document has any, they'll be found by the ListBkMrks macro. You'll need to decide which ones to keep/discard. Cheers -- macropod [MVP - Microsoft Word] "Richard" wrote in message ... Your macro's were a great help! What about duplicate bk marks? How can I delete those? Thanks, Richard "macropod" wrote in message ... Hi Richard, Getting rid of them is easy enough with a macro, but be careful - Word may actually be using them. For example, if your document has cross-references to headings, you'll likely have bookmarks prefixed with '_Ref'. Delete those and your cross-references are history. To see what all these bookmarks are and what they refer to, run the following code. It will produce a listing at the end of the document: Sub ListBkMrks() Dim oBkMrk As Bookmark, oBmk As Variant ActiveDocument.Bookmarks.ShowHidden = True If ActiveDocument.Bookmarks.Count 0 Then For Each oBkMrk In ActiveDocument.Bookmarks With Selection .EndKey Unit:=wdStory .InsertAfter vbCrLf .InsertAfter oBkMrk.Name & " " .EndKey Unit:=wdStory oBmk = ActiveDocument.Fields.Add(Range:=Selection.Range, _ Text:=oBkMrk.Name, PreserveFormatting:=False) End With Next oBkMrk End If End Sub After you've run this, you can see which ones might not be needed. You can probably safely kill off any empty bookmarks, for which you can use the following code: Sub KillEmptyBkMrks() Dim oBkMrk As Bookmark, oBmk As Variant ActiveDocument.Bookmarks.ShowHidden = True If ActiveDocument.Bookmarks.Count 0 Then For Each oBkMrk In ActiveDocument.Bookmarks If ActiveDocument.Bookmarks(oBkMrk).Empty = True Then oBkMrk.Delete Next oBkMrk End If End Sub If you then re-run the 'ListBkMrks' macro, the listing may be significantly shorter. Any other unwanted bookmarks are best deleted manually. Cheers -- macropod [MVP - Microsoft Word] "Richard" wrote in message ... I am using Word 2000 & I seem to have 1000's of hidden bookmarks. How can I get rid of them, besides using the bookmark dialog box which deletes them one by one? I do have about 60 that I would like to keep if possible, but would sacrifice them if need be to get rid of the 1000's. -- Later, -- Richard -- |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Editing bookmarks in footer on last page only | Page Layout | |||
bookmarks shown in doc | Microsoft Word Help | |||
Bookmarks, hyperlinks and 'save as' | Microsoft Word Help | |||
troubleshooting hyperlink bookmarks | Page Layout | |||
Bookmarks appearing in HTML Format document links | Microsoft Word Help |