Hallo,
ich öffne wie folgt ein Word-Dokument und befülle dies mit meinen Daten per Textmarke.
Dabei unterscheide ich durch zwei Buttons, welches Word-Dokument geöffnet werden soll, da ich verschidene Dokumente erstellen möchte.
Delphi-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21:
| Result := ExtractFilePath(ParamStr(0)); ShowMessage(Result);
Result := ExtractFilePath(ParamStr(0)); ShellExecute(Application.Handle, PChar('open'), PChar(Result+'Verkauf-Ohne-Garantie.doc'), nil, nil, SW_SHOW);
vWhat:=wdGoToBookmark;
vBookmark:='Name'; WordApplication1.Selection.GoTo_(vWhat,emptyParam,emptyParam,vBookmark); WordApplication1.Selection.TypeText(Name.Text);
vBookmark:='geb'; WordApplication1.Selection.GoTo_(vWhat,emptyParam,emptyParam,vBookmark); WordApplication1.Selection.TypeText(Geb.Text); |
Das erste mal funktioniert es einwandfrei, wenn ich das Programm aber nicht schließe und ein zweites mal déines der Dokument öffnen möchte bekomme ich folgende Fehlermeldung:
Im Projekt ist eine Exception der Klasse EOleException aufgetreten.
Meldung:'Der RPC-Server ist nicht verfühgbar'. Der Prozess wurde angehalten.
Was muss ich tun, damit dies funktioniert??
Ich hoffe Ihr könnt mir helfen.
Gruß Steffen
Moderiert von
raziel: Delphi-Tags hinzugefügt