call Winword

call Winword

Postby Silvio » Sun Mar 27, 2011 7:43 am

I made last year two small function to call wiword,


Code: Select all  Expand view

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

Re: call Winword

Postby anserkk » Sun Mar 27, 2011 8:29 am

Use

TRY
CATCH
END
User avatar
anserkk
 
Posts: 1332
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: call Winword

Postby Silvio » Sun Mar 27, 2011 8: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
User avatar
Silvio
 
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Re: call Winword

Postby Jack » 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
Jack
 
Posts: 288
Joined: Wed Jul 11, 2007 11:06 am

Re: call Winword

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 112 guests