Autor Beitrag
Das S
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 101

Win XP
D7 Prof
BeitragVerfasst: Mo 06.06.05 06:40 
Hi,

ich möchte einen Serienbrief mit folgenden Code erstellen:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
var vfilename:olevariant;
var amailmerge:Mailmerge;
var vpause:Olevariant;
var vsave:Olevariant;
begin
vfilename:=label1.Caption;
wordapplication1.Connect;
wordapplication1.Documents.OpenOld(vfilename,Emptyparam,Emptyparam,Emptyparam,Emptyparam,Emptyparam,Emptyparam,Emptyparam,Emptyparam,Emptyparam);
worddocument1.ConnectTo(wordapplication1.ActiveDocument);
wordapplication1.Visible:=true;
vpause:=true;
amailmerge:=worddocument1.MailMerge;
amailmerge.Destination:=wdsendtonewdocument;
amailmerge.Execute(vpause);
vsave:=false;
wordapplication1.Documents.Close(vsave,emptyparam,emptyparam);
worddocument1.Disconnect;
wordapplication1.Disconnect;
end;


Das Dokument wird zwar geöffnet aber es erscheint dann die Fehlermeldung "Das angeforderte Objekt ist nicht verfügbar". Diese Meldung tritt dann auf sobald er an die Zeile amailmerge:=worddocument1.mailmerge kommt. Ich habe bald den Eindruck, daß ich zu doof bin, ein Serienbrief in Word 2003 zu erstellen. Kann mir da einer weiterhelfen ?

Vielen Dank

Steffen

Moderiert von user profile iconTino: Code- durch Delphi-Tags ersetzt.
Moderiert von user profile iconTino: Topic aus VCL (Visual Component Library) verschoben am Mo 06.06.2005 um 08:24
Keldorn
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 2266
Erhaltene Danke: 4

Vista
D6 Prof, D 2005 Pro, D2007 Pro, DelphiXE2 Pro
BeitragVerfasst: Sa 11.06.05 12:06 
Hallo

einfach mal einen Serienbriefdokument per hand im Word öffnen, erhälst du eine Meldung mit einem SQL-Befehl-Blablabla
dann hilft dir ein Registry-Eintrag:

mypage.bluewin.ch/re.../MMData.htm#MMData10
support.microsoft.co...scid=kb;en-us;825765

Mfg Frank

_________________
Lükes Grundlage der Programmierung: Es wird nicht funktionieren.
(Murphy)