#1   Report Post  
Armando Szapiro
 
Posts: n/a
Default Removing Unused Bookmarks

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.
--
Armando Szapiro
HaBotzrim 22/5
75498 - Rishon Letzion - Israel
+972 3 941 4439
0524 201 333


  #2   Report Post  
Armando Szapiro
 
Posts: n/a
Default

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




"Armando Szapiro" escribió en el mensaje
...
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.
--
Armando Szapiro
HaBotzrim 22/5
75498 - Rishon Letzion - Israel
+972 3 941 4439
0524 201 333




Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Remove unused styles Klaus Löffelmann Page Layout 7 December 30th 04 12:29 AM
Add bookmarks in header/footer Kind writer/user/programmer Microsoft Word Help 1 December 7th 04 08:55 PM
Lock portion of the document after inserting bookmarks Sesame Microsoft Word Help 2 December 7th 04 04:49 AM
help on bookmarks hsg Microsoft Word Help 3 December 5th 04 11:37 AM
How to protect bookmarks Flip Microsoft Word Help 6 November 30th 04 01:38 PM


All times are GMT +1. The time now is 09:57 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"