PowerPoint Automatisierung, Typen-Problem (win32com)
Verfasst: Dienstag 6. März 2007, 11:23
Hi Leute,
jetzt muss ich mich mit meinem Problem doch noch an Euch wenden:
Ich möchte mit PowerPoint 2007 (mit installiertem PDF u. XPS-Plugin) ein simples PDF exportieren. Das geht mit der SaveAs-Methode oder mit ExportAsFixedFormat. Wobei mit der SaveAs-Methode keine Qualitätseinstellung berücksichtigt wird. Daher möchte ich es mit der anderen Variante machen.
ExportAsFixedFormat akzeptiert u.a. zwei Argumente, die in Python anscheinend als Python-Objekt übergeben werden müssen:
Sub ExportAsFixedFormat(Path As String, FixedFormatType As PpFixedFormatType, [Intent As PpFixedFormatIntent = ppFixedFormatIntentScreen], ...)
VB akzeptiert für FixedFormatType und Intent auch Ints (beide=2). Wie mache ich das in Python ? Kann mir da jemand helfen ?
Dies habe ich vor:[/code]
jetzt muss ich mich mit meinem Problem doch noch an Euch wenden:
Ich möchte mit PowerPoint 2007 (mit installiertem PDF u. XPS-Plugin) ein simples PDF exportieren. Das geht mit der SaveAs-Methode oder mit ExportAsFixedFormat. Wobei mit der SaveAs-Methode keine Qualitätseinstellung berücksichtigt wird. Daher möchte ich es mit der anderen Variante machen.
ExportAsFixedFormat akzeptiert u.a. zwei Argumente, die in Python anscheinend als Python-Objekt übergeben werden müssen:
Sub ExportAsFixedFormat(Path As String, FixedFormatType As PpFixedFormatType, [Intent As PpFixedFormatIntent = ppFixedFormatIntentScreen], ...)
VB akzeptiert für FixedFormatType und Intent auch Ints (beide=2). Wie mache ich das in Python ? Kann mir da jemand helfen ?
Dies habe ich vor:
Code: Alles auswählen
import win32com.client
myPowerpoint = win32com.client.Dispatch('Powerpoint.Application')
myPowerpoint.Activate()
myPresentation = myPowerpoint.Presentations.Open("C:\\testdokumente\\ppt\\Praesentation.ppt")
myPowerpoint.ActivePresentation.ExportAsFixedFormat(Path="c:\\mypdf.pdf", FixedFormatType=2, Intent=2)