Alaska Software Inc. - Word
Username: Password:
AuthorTopic: Word
Salvatore Megna Word
on Fri, 31 Oct 2014 10:41:29 +0100
Good morning,
please there is someone that can give me an prg example for create a 
word file?

Thanks
César Calvo Re: Word
on Fri, 31 Oct 2014 19:05:35 +0100
Here you are one example:

//----------------------------------------------------------------------------------------//

#include "activex.ch"

PROCEDURE PRUWORD()
LOCAL oWord,oBM,oDoc, cFile, cSaveAs, objDoc, objSelection

oWord := CreateObject("Word.Application")
IF Empty( oWord )
   MsgBox( "Microsoft Word is not installed" )
   ELSE

   cFile := CurDrive() + ":\" + CurDir() + "\" + 'testdoc.docx'

   oWord:Caption := "Test Caption"
   oWord:Visible := True

   objDoc := oWord:Documents:Add()

   oWord:Selection:InsertAfter("CESAR" + CHR(13))
   oWord:Selection:InsertAfter("César Calvo")

   objDoc:SaveAs(cFile)

   oWord:Quit()
   oWord:destroy()

  ENDIF

RETURN

//----------------------------------------------------------------------------------------//


"Salvatore Megna"  escribió en el mensaje de 
noticias:5e06c2c4$4edf4829$45280@news.alaska-software.com...

Good morning,
please there is someone that can give me an prg example for create a
word file?

Thanks


testdoc.docx