COM and Powerpoint control

Harald Singer singer at itl.atr.co.jp
Tue Nov 30 09:08:59 EST 1999


Hi,

I am looking for an example of an "outside controlled" PowerPoint
presentation using COM. My final goal is to time-align the slides
presentation with an audio file, because the PowerPoint internal
slide-show timing is massively broken.

The following code snippet worked promisingly well on Win98:

 from win32com.client import constants, Dispatch

 x = Dispatch('Powerpoint.Application.8')
 x.Presentations.Open(FileName='c:\temp\COMTutorial.ppt')
 x.ActiveWindow.ViewType = constants.ppViewNotesPage

Now, I tried to record a macro to see what commands might be used in
slideshow mode, but looking at the generated VB code, I can't see any
commands that advance the slideshow.

-- VB snippet start ---
Sub Macro1()
'
 ppShowAll
        .AdvanceMode = ppSlideShowUseSlideTimings
        .PointerColor.SchemeColor = ppForeground
        .Run
    End With
    SlideShowWindows(Index:=1).View.Exit
End Sub'
-- VB snippet end ---

Any help or code fragments are appreciated. BTW, I did a search
for this but nothing relevant came up.
-- 
Harald Singer	ATR-ITL		singer at itl.atr.co.jp	++81-774-95-1389





More information about the Python-list mailing list