A Microsoft Word forum. Microsoft Office Word Forum - WordBanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Microsoft Office Word Forum - WordBanter forum » Microsoft Word Newsgroups » Formatting Long Documents
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Removing Unused Bookmarks



 
 
Thread Tools Display Modes
  #1  
Old November 30th 04, 10:14 AM
Armando Szapiro
external usenet poster
 
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


Ads
  #2  
Old December 1st 04, 06:23 PM
Armando Szapiro
external usenet poster
 
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




 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
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 04:39 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Copyright ©2004-2019 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.