Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Delphi Word: mit Ole Fußzeile erstellen (https://www.delphipraxis.net/121758-word-mit-ole-fusszeile-erstellen.html)

moppedfahrer 3. Okt 2008 23:04


Word: mit Ole Fußzeile erstellen
 
Moin moin,
Ich würde gerne über die ole Automation von Word eine Fußzeile einfügen.
Ich habe mir in Word das Makro dazu aufgezeichnet, aber AttachedTemplate wird von delphi nicht erkannt ?! Weiß jemand wie man das lösen könnte ?

Das Makro sieht folgendermaßen aus:
Delphi-Quellcode:
WordBasic.ViewFooterOnly
ActiveDocument.AttachedTemplate.BuildingBlockEntries(" Leer").Insert Where _
        :=Selection.Range, RichText:=True
Bin für jede Hilfe dankbar :-D

omata 4. Okt 2008 18:14

Re: Word: mit Ole Fußzeile erstellen
 
Delphi-Quellcode:
  try
    WordApplication.Connect;
    WordApplication.Visible:=true;
    WordApplication.Documents.Add(EmptyParam, EmptyParam, EmptyParam, EmptyParam);
    WordApplication.ActiveWindow.ActivePane.View.SeekView:=wdSeekCurrentPageFooter;
    WordApplication.Selection.TypeText('Dies ist meine neue Fusszeile.');
    WordApplication.ActiveWindow.ActivePane.View.SeekView:=wdSeekMainDocument;
  finally
    WordApplication.Disconnect;
  end;

toms 4. Okt 2008 19:04

Re: Word: mit Ole Fußzeile erstellen
 
oder evtl. so: OleVariant(ActiveDocument).AttachedTemplate....

moppedfahrer 5. Okt 2008 02:23

Re: Word: mit Ole Fußzeile erstellen
 
Super vielen Dank !!! :thumb: :thumb: :thumb:


Alle Zeitangaben in WEZ +1. Es ist jetzt 12:31 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz