Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
CreateNewDocument in Excel or Word
Message
 
À
25/08/2005 04:41:35
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP1
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01043559
Message ID:
01043724
Vues:
7
As I said no metter what version you use this must works if you have MS Word installed. BUT you must add oWord property in the form, no metter how, in the designer with Go to Form menu choose add property and type oWord or programaticly with
thisform.AddProperty("oWord")

>hi,
>i use vfp8,
>i try the code as it is
>i get error message
>Property Oword is not found
>
>
>thanks.
>
>>The same way, there is no difference what version of VFP you use.
>>
>>>hi,
>>>how i do that via vfp8
>>>thanks.
>>>
>>>>>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")
>>>>
>>>>*****************
>>>>*** new document
>>>>*****************
>>>>thisform.oWord.Documents.Add()
>>>>thisform.oWord.ActiveDocument.SaveAs('new_doc_name')
>>>>****************
>>>>*** or
>>>>*** open old document
>>>>****************
>>>>thisform.oWord.Documents.Open('old_doc_name')
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform