I'm using foxpro to automate a search through thousands of files for
hundreds of search terms. I'm writting the results to a file
Here is the basic code:

<<<Begin code>>>

THIS.oWord=CREATEOBJECT("Word.Application")
....CODE CODE

cdoc=TRIM(filenames->cpath)
oDocument=THISFORM.oWord.Documents.OPEN(cdoc,.F.,.T.)
oRange=oDocument.RANGE
oRange.FIND.MatchCase=.F.
myend=oRange.END
SELECT srchfor
SCAN
srchtext=ALLTRIM(srchfor->srchterm)
oRange.FIND.TEXT=m.srchtext
oRange.START=0
oRange.END=m.myend
lfound=.F.
oRange.FIND.clearformatting
lfound=oRange.FIND.Execute()
IF lfound
..... CODE CODE CODE
ENDIF

ENDSCAN

<<<End code>>>

It works fine I get thousands of hits BUT it misses items in footnotes.
WHY WHY??

Please help if you can. This is for an important job and I'm stymied

Thank You

Re: Word Automation - Need help by Bernhard

Bernhard
Wed Jun 29 04:12:28 CDT 2005

Hi Dave,

> It works fine I get thousands of hits BUT it misses items in footnotes.
> WHY WHY??
Have a look at StoryRanges in Word VBA help file.

hth
Bernhard Sander