removing all bookmarks at one time
-
- Lounger
- Posts: 35
- Joined: 21 Apr 2010, 19:19
removing all bookmarks at one time
Is there a way to remove all bookmarks at the same time?
-
- gamma jay
- Posts: 25455
- Joined: 17 Mar 2010, 17:33
- Location: Cape Town
Re: removing all bookmarks at one time
Hi Deborah,
Try the macros at this link. They have been confirmed to work fine!
Link: http://support.microsoft.com/kb/184041
Try the macros at this link. They have been confirmed to work fine!
Link: http://support.microsoft.com/kb/184041
Regards,
Rudi
If your absence does not affect them, your presence didn't matter.
Rudi
If your absence does not affect them, your presence didn't matter.
-
- Administrator
- Posts: 78857
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: removing all bookmarks at one time
For most situations, this simple macro will do:
Code: Select all
Sub RemoveBookmarks()
Dim bmk As Bookmark
For Each bmk In ActiveDocument.Bookmarks
bmk.Delete
Next bmk
End Sub
Best wishes,
Hans
Hans
-
- 5StarLounger
- Posts: 704
- Joined: 28 Jan 2010, 22:47
- Location: Alien Country (Roswell NM)
Re: removing all bookmarks at one time
Hans, my Word 2010 document has an Attachment with separate page numbering (that I learned how to do from the Lounge with PAGEREF arithmetic). After I remove all bookmarks, I need to insert a bookmark just prior to the last section break in the document, so the Attachment page numbering works. What code should I append to the RemoveBookmarks macro to accomplish this?
Something like: go to end of document, search up for section break, insert bookmark Att just ahead of section break.
Something like: go to end of document, search up for section break, insert bookmark Att just ahead of section break.
Sundog
-
- Administrator
- Posts: 78857
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: removing all bookmarks at one time
Does this do what you want?
Code: Select all
Dim lngPos As Long
Dim rng As Range
lngPos = ActiveDocument.Sections(ActiveDocument.Sections.Count - 1).Range.End - 1
Set rng = ActiveDocument.Range(lngPos, lngPos)
ActiveDocument.Bookmarks.Add Name:="Att", Range:=rng
Best wishes,
Hans
Hans
-
- 5StarLounger
- Posts: 704
- Joined: 28 Jan 2010, 22:47
- Location: Alien Country (Roswell NM)
-
- 5StarLounger
- Posts: 704
- Joined: 28 Jan 2010, 22:47
- Location: Alien Country (Roswell NM)