Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Long Documents / December 2004

Tip: Looking for answers? Try searching our database.

Removing Unused Bookmarks

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Armando Szapiro - 30 Nov 2004 09:14 GMT
Is there any procedure or macro to remove unused or/and unreferenced
bookmarks? I have a lot of them in some documents and I need to "clear" them
before translating.
Signature

Armando Szapiro
HaBotzrim 22/5
75498 - Rishon Letzion - Israel
+972 3 941 4439
0524 201 333

Armando Szapiro - 01 Dec 2004 17:23 GMT
I programmed the next Macro and works fine.

Sub ClearBookmarks()
'
' ClearBookmarks Macro
' Macro grabada el 01/12/2004 por Armando Szapiro
'
   Dim intNumBookmarks As Integer
   intNumBookmarks = ActiveDocument.Bookmarks.Count
   Dim ToDelete(intNumBookmarks)
   ActiveWindow.View.ShowFieldCodes = True

   For i = 1 To intNumBookmarks
       nombre = ActiveDocument.Bookmarks(i).Name

       Selection.HomeKey Unit:=wdStory
       Selection.Find.ClearFormatting
       With Selection.Find
           .Text = nombre
           .Replacement.Text = ""
           .Forward = True
           .Wrap = wdFindAsk
           .Format = False
           .MatchCase = False
           .MatchWholeWord = False
           .MatchKashida = False
           .MatchDiacritics = False
           .MatchAlefHamza = False
           .MatchControl = False
           .MatchWildcards = False
           .MatchSoundsLike = False
           .MatchAllWordForms = False
       End With
       If Not Selection.Find.Execute Then
           d = d + 1
           ToDelete(d) = nombre
       End If
   Next i
   If d > 0 Then
       For i = d To 1 Step -1

           ActiveDocument.Bookmarks(ToDelete(i)).Delete

       Next i
   End If

End Sub

> Is there any procedure or macro to remove unused or/and unreferenced
> bookmarks? I have a lot of them in some documents and I need to "clear" them
> before translating.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.