We're using code to generate a MailMerge through MS Word with some degree of success.
We can get things as far as creating the required DataSource (a data document) and performing a MailMerge with Destination of the printer.
What the code (below) does is gets as far as starting up MS Word and having the 'Print' prompt displayed to the user - which is OK as all we then need to do is click the 'Print' button.
Ideally we want this to be automated.
Our code so far :
wrdMailMerge.Destination = Word.WdMailMergeDestination.wdSendToPrinter;
WrdMailMerge.DataSource.FirstRecord = (int)Word.WdMailMergeDefaultRecord.wdDefaultFirstRecord;
wrdMailMerge.DataSource.LastRecord = (int)Word.WdMailMergeDefaultRecord.wdDefaultLastRecord;
wrdApp.Visible = true;
wrdMailMerge.Execute(ref oTrue);
As stated, this calls up MS Word and is ready to print (following confirming the clicking of the Print button).
Ideally we want to get over this last hurdle such that it is all automated.
Can anyone help us over that last bit ?
Thanks in advance
Steve
We can get things as far as creating the required DataSource (a data document) and performing a MailMerge with Destination of the printer.
What the code (below) does is gets as far as starting up MS Word and having the 'Print' prompt displayed to the user - which is OK as all we then need to do is click the 'Print' button.
Ideally we want this to be automated.
Our code so far :
wrdMailMerge.Destination = Word.WdMailMergeDestination.wdSendToPrinter;
WrdMailMerge.DataSource.FirstRecord = (int)Word.WdMailMergeDefaultRecord.wdDefaultFirstRecord;
wrdMailMerge.DataSource.LastRecord = (int)Word.WdMailMergeDefaultRecord.wdDefaultLastRecord;
wrdApp.Visible = true;
wrdMailMerge.Execute(ref oTrue);
As stated, this calls up MS Word and is ready to print (following confirming the clicking of the Print button).
Ideally we want to get over this last hurdle such that it is all automated.
Can anyone help us over that last bit ?
Thanks in advance
Steve