[python-win32] Getting the text of the first slide of a PowerPoint file

Tim Roberts timr at probo.com
Fri Apr 28 18:50:38 CEST 2006


On Thu, 27 Apr 2006 07:27:50 -0400, "Daniel Greenfeld"
<pydanny at gmail.com> wrote:

>On to part 2 of my project.  I need to be able to get the text of the
>first slide out of a lot of Powerpoint files.  If anyone can give me
>some handy hints, that would be appreciated.
>  
>

PowerPoint is one program that I've never tried to automate, but the
same techniques you used in Word should work here.

Here is the start page in MSDN that describes the PowerPoint object model:
   
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/modcore/html/deovrMicrosoftPowerPoint2000.asp

It looks like you should be able to start from the Application object,
then use the ActivePresentation property to get a Presentation object,
then get the first Slide from the Slides collection.  The text is stored
as a series of TextFrame objects in the Shapes collection.

The rest is easy...

>By the way, thanks to Tim, my script to handle all the word documents
>is running today in 26 batches.  This list has been very helpful.
>  
>

I'm glad to hear this.  IMHO, this is exactly the kind of task that
Python is perfect for.

-- 
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.



More information about the Python-win32 mailing list