Supercharge your PowerPoint productivity with
Supercharge your PPT Productivity with PPTools - Click here to learn more.

PPTools

Image Export converts PowerPoint slides to high-quality images.

Shape Styles brings styles to PowerPoint. Apply complex formatting with a single click.

Merge Excel data into PowerPoint presentations to create certificates, awards presentations, personalized presentations and more

FixLinks prevents broken links when you distribute PowerPoint presentations

Optimizer saves disk space and bandwidth, "right-sizes" your PowerPoint presentations for email, screenshow or printing

PPT2HTML gives you full control of PowerPoint HTML output, helps meet Section 508 accessibility requirements

Prep4PDF preserves interactivity in PowerPoint presentations when you convert to PDF

Export slides as graphics

PowerPoint's SaveAs functions are rather limited when it comes to saving slides as JPG, WMF and other graphics formats under VBA program control.

A much more useful solution is the .Export method.

Here's an example:


Sub ExportMe()
    Dim ExportPath As String   ' drive:\path to export to
    Dim Pixwidth As Integer    '  size in pixels of exported image
    Dim Pixheight As Integer
    Dim oSlide As Slide

    ' Edit to suit
    Pixwidth = 1024    '  arbitrarily ... set whatever value you like here

    ' Set height proportional to slide height
    Pixheight = (Pixwidth * ActivePresentation.PageSetup.Slideheight) / ActivePresentation.PageSetup.Slidewidth

    ExportPath = ActivePresentation.Path & "\"

    Set oSlide = ActiveWindow.View.Slide
    With oSlide
        .Export ExportPath & "Slide" & CStr(.SlideIndex) & ".JPG", "JPG", Pixwidth, Pixheight
    End With

End Sub

Note that TIFFs are a problem area. There's no TIFF export filter in PowerPoint 97. The TIFF export filter in PowerPoint 2000 ignores your resolution specification and always exports at 72dpi times current slide height and width. The TIFF export filter in PowerPoint 2002 randomly produces TIFFs that some apps, notably Photoshop, can't open. If at all possible, skip TIFF. Use PNG instead.

In addition, some of the export filters (JPG, for example) are optional parts of the PowerPoint/Office 97 install. If the filters aren't installed, attempting to use it will trigger an error.

See How do I use VBA code in PowerPoint? to learn how to use this example code.


Did this solve your problem? If so, please consider supporting the PPT FAQ with a small PayPal donation.
Page copy protected against web site content infringement by Copyscape Contents © 1995 - 2011 Stephen Rindsberg, Rindsberg Photography, Inc. and members of the MS PowerPoint MVP team. You may link to this page but any form of unauthorized reproduction of this page's contents is expressly forbidden.
Español    Deutsch    Français    Português    Italiano    Nederlands    Greek    Japanese    Korean    Chinese

Supercharge your PPT Productivity with PPTools

content authoring & site maintenance by
Friday, the automatic faq maker (logo)
Friday - The Automatic FAQ Maker

Export slides as graphics
http://www.pptfaq.com/FAQ00022_Export_slides_as_graphics.htm
Last update 07 June, 2011
Created: