Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
OLE with MS Word
Message
De
04/02/1999 01:41:27
 
 
À
03/02/1999 11:55:53
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00183498
Message ID:
00183783
Vues:
25
>Please, I'm looking for the syntax in VFP6.0 to open Word and a file in Word. I've tried:
> oleObj = CREATEOBJECT("WORD.APPLICATION") this give an error
>
> oleObj = CREATEOBJECT("WORD.BASIC") this does not give an error
>
>
> oleobj.documents.open filename:="c:\test.doc" (an existing doc)
> this gives an error
>
>I've hunted through the documentation and can't find a sample. Please point me in the right direction. Thanks
>
>judy scofield

Here is the code I use for executing a Word97 mail merge.

oWord = CREATEOBJECT("Word.Application")
oWord.Documents.Open("Reports\Venteliste.doc")
oWord.Documents("Venteliste.doc").Select
oWord.Documents("Venteliste.doc").MailMerge.Destination = 0 && 0 - New word doc
oWord.Documents("Venteliste.doc").MailMerge.Execute
oWord.Activedocument.Printout

oWord.Activedocument.Close
oWord.Documents("Venteliste.doc").Close

RELEASE oWord
Benn Kjaer
MS Certified Professional - Visual Foxpro

"There is something rotten in the state of Denmark"
"Why make user-friendly programs, when there aren’t any friendly users :o)"
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform