﻿import win32com.client
import os
import win32com.gen_py.MSO as MSO # contains constants refering to Microsoft Office Objects
import win32com.gen_py.MSPPT as MSPPT # contains constants refering to Microsoft Office Power Point Objects

g = globals() # a dictonary of global vlaues, that will be the constants of the two previous imports
for c in dir(MSO.constants): g[c] = getattr(MSO.constants, c) # globally define these
for c in dir(MSPPT.constants): g[c] = getattr(MSPPT.constants, c)

# Open PowerPoint
Application = win32com.client.Dispatch("PowerPoint.Application")
Application.Visible = True

# Create new presentation
#myPresentation = Application.Presentations.Add()

#Open presentation 
myPresentation = Application.Presentations.Open("C:\\school.ppt")

myPresentation.SaveAs('C:\\pptsave',ppSaveAsPNG)
myPresentation.SaveAs('C:\\pptsave',ppSaveAsJPEG)
