29 May 2014

Exporting PowerPoint Slides with Specific Heights and Widths

I found myself in need of exporting PowerPoint slides from a presentation and was fairly excited when I found that you could save them off in standard image formats. The problem is that Microsoft conveniently exports all images with a resolution of 960 x 720 pixels, which is not the resolution I wanted.  You can, however, specify the resolution if you are willing to put a macro into your project:

Sub ExportSlides()
  For i = 1 To ActiveWindow.Selection.SlideRange.Count
    Dim fileName As String
    If (i > 10) Then
      fileName = “C:\PowerPoint Export\Slide” & i & “.png”
    Else
      fileName = “C:\PowerPoint Export\Slide0” & i & “.png”
    End If
    ActiveWindow.Selection.SlideRange(i).Export fileName, “PNG”, 1280, 720
  Next
End Sub

When you call the Export method you can specify the file type as well as the dimensions to use when creating the image.  If the macro approach is not your thing, then you can also modify the default settings through the registry:

http://support.microsoft.com/kb/827745

Keep up to date with Simple-Talk

For more articles like this delivered fortnightly, sign up to the Simple-Talk newsletter

This post has been viewed 2894 times – thanks for reading.

  • Rate
    [Total: 0    Average: 0/5]
  • Share

Damon Armstrong is a Senior Engineering Team Lead with GimmalSoft in Dallas, Texas, and author of Pro ASP.NET 2.0 Website Programming. He specializes in Microsoft technologies with a focus on SharePoint and ASP.NET. When not staying up all night coding, he can be found playing disc golf, softball, working on something for Carrollton Young Life, or recovering from staying up all night coding.

View all articles by Damon Armstrong