"find" seems to ignore footnotes in macros

  • Thread starter Thread starter Dominik
  • Start date Start date
D

Dominik

Hello alltogether!

I want to write a macro that sorts my biblio references. When i use
"find" in word 2003 to search for "[11]" it finds [11] in the text and
also in the footnote, but when i use find in a macro it seems, that the
footnotes arent searched. What could i do? I tried with:

Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.text = "[11]"
.Replacement.text = "[11x]"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False

End With
Selection.Find.Execute

but no footnotes are searched.

I hope for help

Dominik
 
Hi Dominik

You need to cycle through all the StoryRanges. Stories in Word include the
main "story", footnotes, comments, headers and footers and so on.

See VBA help for NextStoryRange for an example of code that finds text
whereever it appears in a document.

Hope this helps.

Shauna Kelly. Microsoft MVP.
http://www.shaunakelly.com/word
 
Back
Top