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.
Don't want to do it yourself?
If you want a simpler, more versatile and easier to use way of exporting slides from PowerPoint, one that's always there when you need it, have a look at the inexpensive PPTools ImageExport add-in.
See How do I use VBA code in PowerPoint? to learn how to use this example code.