06-05-2012, 04:25 AM
Macro Macro1754
typelib Word {00020905-0000-0000-C000-000000000046} 8.0
str files
if(!inp(files "Please specify the location of the files:" "TestDocRetrieve" "C:\test\*.doc")) ret
Dir d1
foreach(d1 files FE_Dir) ;;for each file that matches the pattern.
,str sPath=d1.FileName(1)
,out sPath
,
,Word.Document d._getfile(sPath)
,Word.Range r
,
,;get all text
,r=d.Range
,lpstr sAllText=r.Text
,;out sAllText