Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Code to Mail Merge with Word?
Message
De
16/04/2012 14:32:24
 
 
À
16/04/2012 08:33:17
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 7
Database:
Visual FoxPro
Divers
Thread ID:
01541578
Message ID:
01541720
Vues:
35
Hi Tamar,

Thank you for your response.

I did find that link while doing some searching on my own, but it doesn't seem to address the problem I'm having.

The following code used to work, then I'm assuming a newer version of Word may have come into play and now it fails at:
.Destination = wdSendToPrinter (Error: 'Destination' is not a by reference property)


#define wdSendToPrinter 1
#define wdDefaultFirstRecord 1
#define wdDefaultLastRecord -16

LOCAL oWord

oWord = CREATEOBJECT([Word.Application]) && W/o this nothing can work, even VFP9 :-))))
oWord.Documents.Open(m.dir+"MyFile.DOC")
With oWord.ActiveDocument.MailMerge
.Destination = wdSendToPrinter
.SuppressBlankLines = .t.
With .DataSource
.FirstRecord = wdDefaultFirstRecord
.LastRecord = wdDefaultLastRecord
EndWith
.Execute()
EndWith
#DEFINE wdDoNotSaveChanges 0
#DEFINE wdSaveChanges -1
#DEFINE wdPromptToSaveChanges -2

oWord.Quit( wdDoNotSaveChanges )

Any further help you can provide is greatly appreciated.

Martha
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform