Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Delphi Excel - Workbook.SaveAs - PDF mit Office Add-In (https://www.delphipraxis.net/128467-excel-workbook-saveas-pdf-mit-office-add.html)

stoxx 30. Jan 2009 11:35


Excel - Workbook.SaveAs - PDF mit Office Add-In
 
Ich habe das Office 2007 Add-In für XPS und PDF installiert.
Ich möchte nun die Excel Datei über OLE als PDF speichern.
So wollte ich das machen, eine pdf Datei ist auch da, aber leider ist es keine PDF.
Die XLFileFormat Enumeration ist also falsch, kennt jemand den richten Zahlenwert für

xlPDF ?

hier sind die anderen, das PDF Add-In ist da leider nicht aufgeführt ...

http://msdn.microsoft.com/en-us/library/bb241279.aspx



Delphi-Quellcode:
   FWorkBook.SaveAs('c:\Test.pdf',
                                xlAddIn,

                                EmptyParam, // Passwort
                                EmptyParam, // WriteResPassword
                                false,     // ReadOnlyRecommended
                                false,     // Create Backup
                                xlNoChange, // AccessMode
                                EmptyParam, // ConflictResolution
                                false,     // AddToMru
                                EmptyParam, // TextCodePage
                                EmptyParam, // TextVisualLayout
                                false,     // Local
                                FLCID);




umd das Add-In geht es:

http://www.microsoft.com/downloads/d...displaylang=de

vielen Dank !

stoxx 4. Feb 2009 01:59

Re: Excel - Workbook.SaveAs - PDF mit Office Add-In
 
Delphi-Quellcode:
const xlPDF = 57


   FWorkBook.SaveAs('c:\test.pdf',
                                xlPDF,

                                EmptyParam, // Passwort
                                EmptyParam, // WriteResPassword
                                false,     // ReadOnlyRecommended
                                false,     // Create Backup
                                xlNoChange, // AccessMode
                                EmptyParam, // ConflictResolution
                                false,     // AddToMru
                                EmptyParam, // TextCodePage
                                EmptyParam, // TextVisualLayout
                                false,     // Local
                                FLCID);

ha !! .. durch probieren mit einer Schleife hab ich jetzt die passenden Konstante gefunden.
57 wars ... fein fein.
Ohne externen Druckertreiber, (ohne PDF Creator) und ohne sonstiges Handstände .. lassen sich nun Excel Dateien mit Office2007 und dem entsprechendem AddIn einfach selbst durch Office abspeichern.
Ich hoffe, die Konstante ist auf jedem System gleich?
Würde mich freuen, wenn das auch mal jemand testen möchte.

gut .. fein fein ..

stoxx 12. Feb 2009 12:19

Re: Excel - Workbook.SaveAs - PDF mit Office Add-In
 
noch eine (bessere) Ergänzung.

mit ActiveWorkbook.ExportAsFixedFormat gehts noch besser:

http://www.rondebruin.nl/pdf.htm

allerdings muss man sich dazu die neuste Excel_TLB und dazu auch die Office_TLB importieren, in der ExcelXP Unit ist das noch nicht dabei ....
(falls mal jemand die Suche anschmeißen sollte)

:-)


Alle Zeitangaben in WEZ +1. Es ist jetzt 07:24 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