Autor Beitrag
elduchte
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 199

Win 2000, Win XP
Delphi 7
BeitragVerfasst: So 25.09.05 09:38 
Hallo,

ich habe ein kleines Hilfsprogramm geschrieben, mit dem ich einige Werte berechne. Diese werden zu einem String zusammengefügt und sollen in ein bereits bestehendes und geöffnetes WORD-Dokument eingefügt werden.

Nun möchte ich nach Klick auf Button

a) ans Ende des WORD-Dokumentes springen
b) einen Zeilenumbruch einfügen
c) den STRING einfügen

Kann mir da jemand ein paar Tipps geben?

Vielen Dank für Eure Hilfe
Gruß
Andi
Land-Gull
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 51

SuSe 9.2, WIN XP
D7 Enter
BeitragVerfasst: So 25.09.05 10:16 
Hi,

probiers mal mir OLE.
Wie das jetzt genau geht weiss ich leider nichtmehr :-(
Aber du findest dazu bestimmt tuts.

mfG
Gull
elduchte Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 199

Win 2000, Win XP
Delphi 7
BeitragVerfasst: So 25.09.05 10:26 
Hi,

habe mich noch nie mit OLE befasst, da ich viel hier im Forum gelesen habe, dass OLE sehr langsam ist.....

Keine andere Ideen?
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 25.09.05 17:09 
Hallo

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
//eine Wordapplication Kompo auf die Form packen
procedure TForm1.Button7Click(Sender: TObject);
Var _what,_which,_unit,_Count:olevariant;
begin
  WordApplication1.Connect;
  try
    with WordApplication1 do
      begin
        //zur letzten Zeile springen
        _what := wdGoToLine;
        _which:= wdGoToLast;
        Selection.GoTo_(_what,_which,emptyparam,emptyparam);
        //ans ende der Zeile
        _unit := wdCharacter;
        _count:=100;
        Selection.Move(_unit,_Count);
        //evtl gibts auch noch wás, damit du gleich ans Ende des Doks springst, mußt du mal in der Word-VB-Hilfe schauen

        //Zeilenumbruch
        selection.TypeParagraph;
        //Text schreiben
        Selection.TypeText('Schreib mich ans Ende');
      end;
  finally
    WordApplication1.Disconnect;
  end;
end;

irgendein Dok muß schon geöffnet sein, wenn du ein eigenes öffnen willst, findest du das hier in zig Beispielen


Mfg Frank

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

Win 2000, Win XP
Delphi 7
BeitragVerfasst: Mo 26.09.05 14:41 
Hallo,

super, vielen Dank, genau das hat mein Problem gelöst.

Kann ich nun noch während der Übergabe des Strings diesen "fett formatieren", so dass er gleich diese Formatierung in Word hat?

Danke
elduchte Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 199

Win 2000, Win XP
Delphi 7
BeitragVerfasst: Mo 26.09.05 16:25 
hallo,
habe es selber herausgefunden.

vielen vielen dank !!!
Ivo@CoMRoK
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 258

Win XP
D3 Prof., D7 Pe.
BeitragVerfasst: Di 20.12.05 14:22 
Wenn du es gefunden hast dann poste es doch bitte. :D
Damit andere Leute die auf Lösungssuche sind in deinem Topic hilfe finden können.

_________________
Fällt der Bauer tot vom Traktor, stand am Waldrand ein Reaktor.
Ein altes indianisches Sprichwort besagt:Es kann gefährlich sein gelben Schnee zu essen.