Registriert seit: 31. Dez 2004
Ort: Stuttgart
4.408 Beiträge
Delphi XE8 Enterprise
|
Re: Open Dialog autoconnect
30. Mär 2010, 07:51
So zum Beispiel :
Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
var FileName:OleVariant;
vWhat, vBookmark:OleVariant;
begin
FileName := 'C:\Test\testdokument.doc';
if assigned(WordApplication1) then
begin
WordApplication1.Connect;
WordApplication1.Documents.OpenOld(FileName, EmptyParam, EmptyParam,
EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam,
EmptyParam, EmptyParam);
WordDocument1.ConnectTo(WordApplication1.ActiveDocument);
WordApplication1.Visible := True;
vWhat:=wdGoToBookmark;
vBookmark:='Name';
WordApplication1.Selection.GoTo_(vWhat,emptyParam,emptyParam,vBookmark);
WordApplication1.Selection.TypeText('Max Mustermann'#13'Dorfstraße 100');
end;
end;
|
|
Zitat
|