Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Automating Word - pesky printer dialog box pops up!
Message
De
01/06/2006 04:08:36
 
 
À
01/06/2006 03:50:11
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows 2000
Divers
Thread ID:
01126397
Message ID:
01126398
Vues:
25
>I have a piece of code that produces financial statements via a Word mailmerge. It works fine except that it brings up a printer dialog box before printing. As we'd like to run this as part of an overnight batch, this is rather annoying! Any suggestions to remove the dialog would be welcomed.
>
>WITH .Documents[1]
> .PageSetup.FirstPageTray = 2 && each statement will only ever be one page long
> .MailMerge.OpenDataSource(THIS.cStatementMergeDataFile)
> .MailMerge.Destination = 1 && Printer
> .MailMerge.Execute()
>ENDWITH
>
>Thanks in advance.
>
>***
>Win2K Professional, Word 97 SR2, Fox 8 SP1

Try:
WITH .Documents[1]
     .PageSetup.FirstPageTray = 2  && each statement will only ever be one page long
     .MailMerge.OpenDataSource(THIS.cStatementMergeDataFile)
     .MailMerge.Destination = 0	&& File
     .MailMerge.Execute()
ENDWITH
oWord.ActiveDocument.PrintOut()
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