"find" seems to ignore footnotes in macros

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
 
S

Shauna Kelly

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top