I am doing a mail merge with Word and it works very well... as long as the
user clicks OK in the Print dialog box. How can I specify that not only I
want the Merge.Destination to be wdSendToPrinter, but I want it sent to the
printer without the dialog box opening. Here is my code:
oWord := CreateOLEObject('word.application');
oWord.Visible := false;
oDocument := oWord.ActiveDocument;
oMerge := oDocument.MailMerge;
oMerge.MainDocumentType := wdFormLetters;
oMerge.Destination := wdSendToPrinter
oMerge.MailAsAttachment := False;
oMerge.MailAddressFieldName := '';
oMerge.MailSubject := '';
oMerge.SuppressBlankLines := True;
oMerge.DataSource.FirstRecord := wdDefaultFirstRecord;
oMerge.DataSource.LastRecord := wdDefaultLastRecord;
// The Execute command is not finished executing that the Print dialog
I found that the printing is being done with the Application.PrintOut...
but where would i put it?
Thanks in advance for any help.