COM and Powerpoint control

Stefan Migowsky smigowsky at dspace.de
Tue Nov 30 11:17:06 EST 1999


Hi, 
 
just use SlideShowWindows.Next, e.g in your code :

from win32com.client import constants, Dispatch

x = Dispatch('Powerpoint.Application.8')
x.Presentations.Open(FileName='c:\temp\COMTutorial.ppt')
x.ActivePresentation.SlideShowSettings.Run()

print " Show first slide for 5 secs"
win32api.Sleep(5000)

print " Show next slide for 5 secs"
x.SlideShowWindows(1).View.Next()

print " Show next slide for 5 secs"
win32api.Sleep(5000)
.
.
.
print " That's all folks"
x.SlideShowWindows(1).View.Exit()


Stefan
--------------------------------------------------------
mailto:smigowsky at dspace.de 		http://www.dspace.de

>-----Original Message-----
>From: Harald Singer [mailto:singer at itl.atr.co.jp]
>Sent: Tuesday, November 30, 1999 3:09 PM
>To: python-list at python.org
>Subject: COM and Powerpoint control
>
>
>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
>
>
>-- 
>http://www.python.org/mailman/listinfo/python-list
>




More information about the Python-list mailing list