FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour call Winword
Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
call Winword
Posted: Sun Mar 27, 2011 07:43 AM
I made last year two small function to call wiword,


Code (fw): Select all Collapse
STATIC function stampa_iscrizione()
      LOCAL oWord
      LOCAL cPath:=CurDrive()+":\"+CurDir()+"\"
   oWord:=TOleAuto():New( "Word.Application" )
   oWord:Documents:Open(cPath+"modelli\iscrizione.doc")
   oWord:Visible := .T.
  * oWord:Set( "WindowState", 1 )  // Maximizado
  * oWord:END()
RETURN


now on windows seven , this func not run because perhaps he the pc have or not haven't the winword office

How we can do, from a fwh application, see if the pc have a wiword office and call the specific office application if our functions need it ?

and I want Know if there are problems with Tole to call Word.application
Best Regards, Saludos



Falconi Silvio
Posts: 1335
Joined: Fri Jun 13, 2008 11:04 AM
Re: call Winword
Posted: Sun Mar 27, 2011 08:29 AM

Use

TRY
CATCH
END

Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
Re: call Winword
Posted: Sun Mar 27, 2011 08:41 AM

ok but
How I can make if on a pc have office 9 or 10 or 11 or 12

Best Regards, Saludos



Falconi Silvio
Posts: 300
Joined: Wed Jul 11, 2007 11:06 AM
Re: call Winword
Posted: Sun Mar 27, 2011 10:02 AM

oWord := TOleAuto():New("Word.Application")
if empty(oWord)
MsgInfo("Word is not present")
else
if VAL(oword:Version) < 12
MsgInfo("It is an old word !")
endif
endif

Posts: 3107
Joined: Fri Oct 07, 2005 06:28 PM
Re: call Winword
Posted: Sun Mar 27, 2011 07:15 PM

sorry

but I believe there is an possibility with (x)harbour to scan the system and know if

how many version of winword exist or there are not installed any version

Best Regards, Saludos



Falconi Silvio

Continue the discussion