call Winword

Post Reply
User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

call Winword

Post by Silvio »

I made last year two small function to call wiword,

Code: Select all

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
User avatar
anserkk
Posts: 1280
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: call Winword

Post by anserkk »

Use

TRY
CATCH
END
User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: call Winword

Post by Silvio »

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

Falconi Silvio
Jack
Posts: 249
Joined: Wed Jul 11, 2007 11:06 am

Re: call Winword

Post by Jack »

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
User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: call Winword

Post by Silvio »

sorry

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

how many version of winword exist or there are not installed any version
Best Regards, Saludos

Falconi Silvio
Post Reply