Powerpoint Export Text and Images

A

Alex

Hi,

i would like to export all slides of a presentation into image files(JPG).
Every image should be placed into a database, therefore i need
some text information to each slide:

- author of the presentation
- title of the presentaion
- date of creation (may be filedate)
- headline of the slide
- additional text of the slide

I would like to code this in C# using System.Runtime.InteropServices
but I didnt find how to get the needed information from the powerpoint
object model. Also i wasnt able to export slide by slide.

Do you have Some hints or sample code?

Thanks a lot!
Alex
 
S

Steve Rindsberg

i would like to export all slides of a presentation into image files(JPG).
Every image should be placed into a database, therefore i need
some text information to each slide:

- author of the presentation
- title of the presentaion
- date of creation (may be filedate)
- headline of the slide
- additional text of the slide

I would like to code this in C# using System.Runtime.InteropServices
but I didnt find how to get the needed information from the powerpoint
object model. Also i wasnt able to export slide by slide.

Couldn't begin to tell you how to do it in C# but the Slide.Export method will
let you export to JPG or other formats at a resolution of your choosing.

For the various document properties PPT maintains:

With ActivePresentation
Debug.Print .BuiltInDocumentProperties("Author")
Debug.Print .BuiltInDocumentProperties("Title")
End With

Not all slides will have a title (headline) but

With ActivePresentation.Slides(1).Shapes
If .HasTitle Then
Debug.Print .Title.TextFrame.TextRange.Text
End If
End With

To pick up the text, something like this:

Dim x As Long
With ActivePresentation.Slides(1).Shapes
For x = 1 To .Placeholders.Count
If .Placeholders(x).PlaceholderFormat.Type = ppPlaceholderBody Then
' it's the body text
Debug.Print .Placeholders(x).TextFrame.TextRange.Text
' note that there may be two of these ... you'll need to
' modify this accordingly
End If
Next x
' this picks up all the shapes with text
For x = 1 To .Count
If .Item(x).HasTextFrame Then
If .Item(x).TextFrame.HasText Then
Debug.Print .Item(x).TextFrame.TextRange.Text
End If
End If
Next x
End With


--
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================
Apologies for the delayed response.
Just back from PowerPoint Live 2004
Had a great time, learned a lot
================================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top