PowerPoint and python

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • marcelcaraciolo
    New Member
    • Jan 2007
    • 1

    #1

    PowerPoint and python

    Hi,

    I'm developing a software in Python that communicates with Powerpoint files. My application has to open the Microsoft Powerpoint 2003 and a file .ppt format and show the presentation.
    The problem is that i started to code the pyhton script, but when i execute it, it only opens the powerpoint 2003 (Microsoft) without open the presentation file (.ppt). ANybody knows if it has a bug at pywin ?

    this is the code:

    import win32com.client
    ppt = win32com.client .Dispatch("Powe rpoint.Applicat ion")
    ppt.Visible=1
    pr=ppt.Presenta tions.Open('C:\ temp\porra.ppt' )
  • bartonc
    Recognized Expert Expert
    • Sep 2006
    • 6478

    #2
    Originally posted by marcelcaraciolo
    Hi,

    I'm developing a software in Python that communicates with Powerpoint files. My application has to open the Microsoft Powerpoint 2003 and a file .ppt format and show the presentation.
    The problem is that i started to code the pyhton script, but when i execute it, it only opens the powerpoint 2003 (Microsoft) without open the presentation file (.ppt). ANybody knows if it has a bug at pywin ?

    this is the code:

    import win32com.client
    ppt = win32com.client .Dispatch("Powe rpoint.Applicat ion")
    ppt.Visible=1
    pr=ppt.Presenta tions.Open('C:\ temp\porra.ppt' )
    Try
    Code:
    import win32com.client
    ppt = win32com.client.Dispatch("Powerpoint.Application")
    ppt.Visible=1
    pr=ppt.Presentations.Open(r'C:\temp\porra.ppt')
    which uses 'r'aw strings for windows path names. Otherwise python sees "\t" which is a tab character.

    Comment

    Working...