27. Juni 2012 13:35
wrdDoc := wrdApp.Documents.Open2000(MainFileName);
wrdDoc.MailMerge.MainDocumentType := 0;
Window.UPDATE(6,Text013);
ParamInt := 7; // 7 = HTML
wrdDoc.MailMerge.OpenDataSource2000(MergeFileName,ParamInt);
Window.UPDATE(6,STRSUBSTNO(Text014,TempDeliverySorter."Correspondence Type"));
CASE TempDeliverySorter."Correspondence Type" OF
TempDeliverySorter."Correspondence Type"::Fax:
BEGIN
wrdDoc.MailMerge.Destination := 3;
wrdDoc.MailMerge.MailAddressFieldName := Text015;
wrdDoc.MailMerge.MailAsAttachment := TRUE;
wrdDoc.MailMerge.Execute
END;
TempDeliverySorter."Correspondence Type"::"E-Mail":
BEGIN
wrdDoc.MailMerge.Destination := 2;
wrdDoc.MailMerge.MailAddressFieldName := Text015;
wrdDoc.MailMerge.MailSubject := TempDeliverySorter.Subject;
wrdDoc.MailMerge.MailAsAttachment :=
wrdDoc.MailMerge.MailAsAttachment OR TempDeliverySorter."Send Word Docs. as Attmt.";
wrdDoc.MailMerge.Execute
END;
TempDeliverySorter."Correspondence Type"::"Hard Copy":
BEGIN
wrdDoc.MailMerge.Destination := 0; // 0 = wdSendToNewDocument
wrdDoc.MailMerge.Execute;
wrdApp.ActiveDocument.PrintOut2000; //Hier würde ich gerne den Print-Dialog bringen
ParamBln := FALSE;
wrdApp.ActiveDocument.Close(ParamBln);
END;
END;