Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Delphi Aufruf eines Word-Serienbriefs (https://www.delphipraxis.net/135698-aufruf-eines-word-serienbriefs.html)

scrato 16. Jun 2009 07:48


Aufruf eines Word-Serienbriefs
 
Hallo zusammen!

Ich arbeite mit Delphi 6 unter XP und wir sind kürzlich von Office 2000 auf Office 2007 umgestiegen.

Mein Problem ist nun, dass wir verschiedene Anwendungen haben, die Serienbriefe unter Word anstoßen. Unter Word 2000 funktionierte das auch wunderbar. Nach dem Umstieg auf Word 2007 behauptet Delphi standhaft, dass diese Methode oder Eigenschaft (in Zeile 11 des Codes) nicht verfügbar sei, weil das Dokument kein Serienbrief-Hauptdokument ist. Wenn ich den Serienbrief aber manuell aufrufe, tut er seinen Dienst wie gewünscht.

Hier mal mein Code:

Delphi-Quellcode:
filename:=GetCurrentDir+'\kuvert.docx';
nosave:=False;
WordApplication1.Disconnect;
WordApplication1.Connect;
WordApplication1.Documents.Open(filename,
  EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam,
  EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam);
WordDocument1.ConnectTo(WordApplication1.ActiveDocument);
WordApplication1.Visible:=True;
Pause:=True;
WordDocument1.MailMerge.Execute(Pause);
WordDocument1.Close(nosave,EmptyParam,EmptyParam);
WordDocument1.Disconnect;
WordDocument1.ConnectTo(WordApplication1.ActiveDocument);
Wäre ganz toll, wenn mir jemand von euch nen Tipp geben könnte, wie man das Problem am einfachsten löst.

Vielen Dank schon im voraus!

scrato


Alle Zeitangaben in WEZ +1. Es ist jetzt 11:22 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz