>I need to create a Word or Excel document from VFP.
>I am trying to use "CreateNewDocument" but can't seam to get the proper writing
>
>Here is the code:
>
>*-*-*-*-*-*
>oWord = CREATEOBJECT( "word.application")
>lcDoc = "testword.doc"
>
>* I have tried
>oWord.CreateNewDocument("testword.doc", .T., .T.)
>* or
>oWord.CreateNewDocument(lcDoc, .T., .T.)
>
>*-*-*-*
>and quite a few different versions but I always get error messages.
>
>Can anyone tell me the proper way?
>Thanks
>Raymond Larche
Raymond,
Try this
thisform.oWord = CreateObject("Word.Application")
thisform.oWord.Documents.Add()
thisform.oWord.ActiveDocument.SaveAs('new_doc_name')
thisform.oWord.Documents.Open('old_doc_name')
_______________________________________________________________
Testing displays the presence, not the absence of bugs.
If a software application has to be designed, it has to be designed correctly!
_______________________________________________________________
Vladimir Zografski
Systems Analyst