Autor Beitrag
Licki
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 132

Knoppix, Win 95, Win 2000, Win NT, Win 98, Win XP
Delphi 3
BeitragVerfasst: Fr 24.10.03 12:05 
Hi...

Hat jemand eventuell einen Rat? Ich habe ein Word-Dokument (Adressettiketten). Ich würde es gerne bearbeiten. Ich würde gerne das Wort November mit dem Wort Dezember ersetzten und das überall im Dokument. Hat jemand eine Ahnung wie ich das mit Delphi machen kann, so dass ich keinen Schritt im Word selbst machen muss?

Danke. :)
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: Fr 24.10.03 12:39 
Hallo

Zeichne Dir in Word ein Makro auf, und gugg dir das in VB an. Da hast du schon mal die Befehle. Anschließend versucht du es, in Delphi per OLE umzusetzen. Wenn du die Serverlkompos verwendest, ist das meist recht einfach.

Mfg Frank

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

Knoppix, Win 95, Win 2000, Win NT, Win 98, Win XP
Delphi 3
BeitragVerfasst: Fr 24.10.03 13:10 
Okay. Danke. :)

Habe nun ein Makro aufgezeichnet, was das macht. Und die Befehle habe ich auch. Hättest du eventuell auch ein Beispiel für mich, also für das umsetzen? Wie ich einen VB Befehl auf das Ole-Object anwende?

Danke im Vorraus.
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 25.10.03 21:13 
Hallo

das hier ist fast 1 zu 1 vom Makro übernommen, es sieht nicht schön aus, aber es geht.
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
Var dummy:olevariant;
begin
  WordApplication1.Selection.Find.ClearFormatting;
  WordApplication1.Selection.Find.Replacement.ClearFormatting;
  With WordApplication1.Selection.Find do
    begin
      Text := 'suchen';
      Replacement.Text := 'ersetzen';
      Forward := True;
      Wrap := wdFindContinue;
      Format := False;
      MatchCase := False;
      MatchWholeWord := False;
      MatchWildcards := False;
      MatchSoundsLike := False;
      MatchAllWordForms := False;
    end;
    dummy := wdReplaceAll;
    WordApplication1.Selection.Find.Execute(emptyparam,emptyparam,emptyparam,emptyparam,emptyparam,emptyparam,emptyparam,emptyparam,emptyparam,emptyparam,dummy);

Ich hab aber keine Ahnung, ob das bei dir geht, ich glaube die Serverkompos gibts erst ab D5?

Mfg Frank

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