Import/Export related procedures in class Slide (PowerPoint VBA)

This page presents procedures from class Slide related to the theme Import/Export: Export and SlideRange.Export

Export

Exports a slide, using the specified graphics filter, and saves the exported file under the specified file name.

Exporting a presentation doesn't set the Saved property of a presentation to True. PowerPoint uses the specified graphics filter to save each individual slide. The names of the slides exported and saved to disk are determined by PowerPoint. They are typically saved by using names such as Slide1.wmf, Slide2.wmf. The path of the saved files is specified in the FileName argument.

Syntax : expression.Export (FileName, FilterName, ScaleWidth, ScaleHeight)

With Application.ActivePresentation.Slides(3)
    .Export "c:\my documents\Graphic Format\" & _
        "Slide 3 of Annual Sales", "JPG"
End With

Arguments

The following arguments are required:

FileName (String) - The name of the file to be exported and saved to disk. You can include a full path; if you don't, Microsoft PowerPoint creates a file in the current folder.

FilterName (String) - The graphics format in which you want to export slides. The specified graphics format must have an export filter registered in the Windows registry. You can specify either the registered extension or the registered filter name. Microsoft PowerPoint will first search for a matching extension in the registry. If no extension that matches the specified string is found, PowerPoint will look for a filter name that matches.

The following arguments are optional

ScaleWidth (Long) - The width in pixels of an exported slide.

ScaleHeight (Long) - The height in pixels of an exported slide.

SlideRange.Export

Exports a range of slides, using the specified graphics filter, and saves the exported file under the specified file name.

Exporting a presentation doesn't set the Saved property of a presentation to True. PowerPoint uses the specified graphics filter to save each individual slide. The names of the slides exported and saved to disk are determined by PowerPoint. They are typically saved by using the following naming convention: Slide1.wmf, Slide2.wmf. The path of the saved files is specified in the FileName argument.

Syntax : expression.Export (FileName, FilterName, ScaleWidth, ScaleHeight)

Dim strFileName As String: strFileName = 
Dim strFilterName As String: strFilterName = 
ActivePresentation.Slides.Range.Export FileName:=strFileName, FilterName:=strFilterName

Arguments

The following arguments are required:

FileName (String) - The name of the file to be exported and saved to disk. You can include a full path; if you don't, Microsoft PowerPoint creates a file in the current folder.

FilterName (String) - The graphics format in which you want to export slides. The specified graphics format must have an export filter registered in the Windows registry. You can specify either the registered extension or the registered filter name. Microsoft PowerPoint will first search for a matching extension in the registry. If no extension that matches the specified string is found, PowerPoint will look for a filter name that matches.

The following arguments are optional

ScaleWidth (Long) - The width in pixels of an exported slide.

ScaleHeight (Long) - The height in pixels of an exported slide.