![]() |
AW: Wordautomation Zeilenabstand einstellen
hallo,
als Beispiel
Delphi-Quellcode:
procedure TForm50.Button1Click(Sender: TObject);
var myword:word_tlb._application; mydocument, myvisible, mysavechanges, mytemplate, newtemplate, mydokumenttype, myorginalformat, myRouteDocument:Olevariant; begin myword:=Word_TLB.CoWordApplication.Create; mytemplate:='Normal'; newtemplate:=False; mydokumenttype:=wdNewBlankDocument; myvisible:=True; mysavechanges:=wdDoNotSaveChanges; myorginalformat:=wdOriginalDocumentFormat; myRouteDocument:=False; try myword.Documents.Add(mytemplate,newtemplate,mydokumenttype,myvisible); myword.Visible:=True; // myword.Quit(mysavechanges,myorginalformat,myRouteDocument); except end; end; hier ist eine gute Erklärung [URL="https://www.delphi-treff.de/tipps-tricks/comoledde/andere-office-anwendungen/excel-mit-ole-automation-steuern/"]https://www.delphi-treff.de/tipps-tricks/comoledde/andere-office-anwendungen/excel-mit-ole-automation-steuern/[/URL] Gruß |
AW: Wordautomation Zeilenabstand einstellen
Hallo Lemmy vielen Dank für die Infos.
Es hat etwas gedauert, bis ich dcloffice2010270.bpl in \21\bin\ gefunden hatte. Gruß Alfred |
AW: Wordautomation Zeilenabstand einstellen
Hallo mmw,
ich habe den Beispiel etwas abgeändert, damit es bei mir läuft.
Delphi-Quellcode:
Wo könnte ich denn auf Querdruck umstellen?
procedure TForm2.Button1.click(Sender: TOjekt);
Var mytemplate: OleVariant; myvisible: OleVariant; newtemplate: OleVariant; mydokumenttype: OleVariant; begin mytemplate := 'Normal'; newtemplate := False; mydokumenttype := wdNewBlankDocument; myvisible := True; myword.connect; myword.Visible := True; myword.Documents.Add(mytemplate,newtemplate,mydokumenttype,myvisible); myword.Selection.Font.Name := 'Courier New'; myword.Selection.Font.Size := 10; myword.Selection.Font.Bold := 1; myword.Selection.TypeText('Hello World'); end; Gruß Alfred |
AW: Wordautomation Zeilenabstand einstellen
Zitat:
Du kannst "verschollene" Dateien auf Festplatten/USB-Sticks etc. am schnellsten mit Everything.exe ![]() Gruß, Andreas |
AW: Wordautomation Zeilenabstand einstellen
Hallo mmw,
ich hab den Querdruck gefunden:
Delphi-Quellcode:
myword.Selection.PageSetup.Orientation := 1; |
AW: Wordautomation Zeilenabstand einstellen
Hallo,
für mein Beispiel muss man die Typbibliothek erstellen und einbinden. Haupsache es funktioniert. Gruß |
AW: Wordautomation Zeilenabstand einstellen
Hallo mmw,
ich habe die Ursache gefunden warum es bei mir funkioniert. Wenn in der Delphi-Komponenten-Palette "Serverkomponenten" die Komponente "TWordApplication" existiert, ist die Typbiliothek bereits installiert. In WordApplikation1 habe ich den Namen auf myword geändert und konnte deshalb Deinen Programmcode weiter verwenden. Gruß Alfred |
Alle Zeitangaben in WEZ +1. Es ist jetzt 11:51 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz