Controlling PowerPoint with Python's win32com. How to access "Save As" option programmatically
Question: I'm trying to open powerpoint via python and then save the slide presentation
as pdf handouts (three to a page). After a bit of googling, I stumbled upon
[this](http://stackoverflow.com/questions/2170830/vba-save-presentation-as-
pdf-in-handout-2x2-format-office-2007). A pretty similar question. however, I
can't seem to get it running. I think I may be 'translating' the VB into
Python incorrectly.

Looking over the MSDN docs [here](http://msdn.microsoft.com/en-
us/library/bb231096.aspx), I attempted to fill in the two required arguments
as a starting point. While it seems to accept the `path`, it throws an error
with the `FixedFormatType`.

My code is as follows.

    
    
    import win32com.client, sys, os
    
    app = win32com.client.Dispatch("PowerPoint.Application")
    app.Visible = True
    
    names = []
    for i in os.listdir(os.getcwd()):
        if i[-1] == 't':
            tmp = os.getcwd() + '\\' + i
            names.append(tmp)
            tmp = ''
    
    
    
    presentation = app.Presentations.Open(names[0])
    presentation.ExportAsFixedFormat(os.getcwd() + '\\test.pdf', 'PpFixedFormatType')
    

I've tried many variations of the `ppFixdFormatType` argument.
`ppFixedFormatTypePDF`, `win32com.ppFixedFormatTypePDF`,
`win32com.client.constants.ppFixedFormatTypePDF`, etc.. but all raise an error
of one type or another. Most are similar to this: `ValueError: invalid literal
for int() with base 10: 'PpFixedFormatType'`


Answer: You may have encountered this bug in PowerPoint's API: [Type mismatch when
using export function of PowerPoint
2007](http://sourceforge.net/p/pywin32/bugs/339/). The solution is to specify
the PrintRange parameter to the ExportAsFixedFormat() call.

