Hi Bernd,
You only counting the fields in one of Word's StoryRanges. You can use
something like the following to get a more accurate count of all fields:
Dim myStoryRange As Range
Dim iFieldCount As Integer
For Each myStoryRange In ActiveDocument.StoryRanges
iFieldCount = iFieldCount + myStoryRange.Fields.Count
Next myStoryRange
MsgBox iFieldCount
AFAIK, there are even some quirks with this. Have a look at the article
"Using a macro to replace text where ever it appears in a document including
Headers, Footers, Textboxes, etc." at
http://www.mvps.org/word/FAQs/MacrosVBA/FindReplaceAllWithVBA.htm
HTH
Quote:
> Hello,
> I have encountered the following problem:
> ActiveDocument.StoryRanges(wdTextFrameStory).Fields.Count
> returns 1, but the document contains more than 1 text field.
> Any idea?
> Thanks,
> Bernd