by Romeo » Tue Nov 07, 2017 5:35 pm
Hi all,
I am using the version FWH 16.02 but i got problem with WORD. My previous version of FWH (8.10) does not have this problem and works very well !!
This simple program does not work with versione FWH 16.02:
function main()
local _cfile:=HB_curdrive()+":\"+curdir()+"\test.doc"
local _oword,_oDoc,_oText,_oFind,_lex,_cfound
_oWord :=TOleAuto():New( "Word.Application" )
_oDoc :=_oWord:Get( "Documents" )
_oWord:Set("Visible",.f.) && HERE I START TO HAVE ERRORs
_oDoc:Open(_cFile )
_oText:=_oWord:Selection()
_oFind:=_oText:Find()
_oFind:Text:="#*#"
_oFind:Wrap:=1
_oFind:Set("MatchWildcards",.t.)
_oFind:Execute()
_lex:="#" $ _oText:Text
_cFound:=alltrim(SubStr(_oText:Text,2,Len(Alltrim(_oText:Text))-2))
if ! empty(_cfound)
msginfo("Found: "+_cFound)
else
msginfo("Not Found !")
endif
_oDoc:Close( 0 )
_oWord:quit()
return nil
****
THIS IS THE SIMPLE FILE .doc:
**start doc
Ciao io sono il sig.#ROSSI MARIO#
** end file doc
MANY, MANY THANKS FOR HELP, HELP !!
Romeo