Autor Beitrag
ingo.
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 37



BeitragVerfasst: Sa 30.04.05 20:14 
Hallo,

hab soeben mich durch das Tutorial www.delphi-forum.de/viewtopic.php?t=152 durchgearbeitet. Hier wird immer zuerst ein Worddocument ausgewaehlt, in dem dann etwas geändert wird.
Besteht auch die Möglichkeit an einem bestimmten Pfad ein solches Dokument zu erstellen, und das neu erstellte dann zu bearbeiten?

Gruß Ingo.
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 30.04.05 20:17 
Hallo,

du brauchst doch bloß ein neues Word-Doc erstellen und das dann speichern.

Mfg Frank

_________________
Lükes Grundlage der Programmierung: Es wird nicht funktionieren.
(Murphy)
ingo. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 37



BeitragVerfasst: So 01.05.05 01:26 
Geht das über form1.WordDocument1.Create()? Wenn ich aber einen String übergebe bekomme ich den Hinweis, dass Tcomponent erwartet wird. Bin neu in der Delphi-Programmierung, deshalb steh ich auf dem Schlauch.
Kannst du bitte Beispielcode listen?
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: So 01.05.05 19:51 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
  WordApplication1.Connect;
  WordApplication1.Visible:=true;
  WordDocument1.ConnectTo(WordApplication1.Documents.Add(EmptyParam,EmptyParam,EmptyParam,EmptyParam));
  WordApplication1.Selection.TypeText('Hallo');
  ...

statt Dich mit dem activedocument zu verbinden, verbindest du dich mit einem neu erstellten. Rest ist so wie uim Tutorial. die paramter bei Documents.Add sind in der VB-Hilfe beim Word erläutert.

Mfg Frank

_________________
Lükes Grundlage der Programmierung: Es wird nicht funktionieren.
(Murphy)
ingo. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 37



BeitragVerfasst: Di 03.05.05 15:25 
Hy,

das Code-Beispiel funzt wunderbar, danke. Habe ein wenig gegoogelt, aber leider nicht explizit für Word VB gefunden, nur so allgemeine Sachen.
Hast du vielleicht noch einen entsprechenden Link?
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: Di 03.05.05 19:58 
nein, ich nutze meist die Makroaufzeichnung und die VB-Hilfe.

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