Export Method
Applies To
Presentation object, Slide object, SlideRange collection object.
Description
Presentation object: Exports each slide in the presentation, using the specified graphics filter, and saves the exported files in the specified folder.
Slide or SlideRange object: Exports a slide, using the specified graphics filter, and saves the exported file under the specified file name.
Syntax 1
expression.Export(Path, FilterName, ScaleWidth, ScaleHeight)
Syntax 2
expression.Export(FileName, FilterName, ScaleWidth, ScaleHeight)
expression Required. An expression that returns a Presentation object (Syntax 1) or a Slide or SlideRange object (Syntax 2).
Path Required String. The path of the folder where you want to save the exported slides. You can include a full path; if you don't do this, PowerPoint creates a subfolder in the current folder for the exported slides.
FileName Required String. The name of the file to be exported and saved to disk. You can include a full path; if you don't, PowerPoint creates a file in the current folder.
FilterName Required String. The graphics format in which you want to export slides. The specified graphics format must have an export filter registered in the system registry. You can specify either the registered extension or the registered filter name. 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.
ScaleWidth Optional Long. The factor by which to scale the width of an exported slide.
ScaleHeight Optional Long. The factor by which to scale the height of an exported slide.
Remarks
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 in the presentation. The names of the slides exported and saved to disk are determined by PowerPoint. They're typically saved as Slide1.WMF, Slide2.WMF, and so on (for example). The path of the saved files is specified in the Path argument.
See Also
SaveAs method.
Example
This example saves the active presentation as a PowerPoint presentation and then exports each slide in the presentation as a Portable Network Graphics (PNG) file that will be saved in the Current Work folder. The example also scales each exported slide to half the height and width of the original.
With ActivePresentation
.SaveAs "c:\current work\Annual Sales", ppSaveAsPresentation
.Export "c:\current work", "png", 0.5, 0.5
End With
This example exports slide three in the active presentation to disk in the JPEG graphic format. The slide is saved as "Slide 3 of Annual Sales.jpg."
With Application.ActivePresentation.Slides(3)
.Export _
"c:\my documents\Graphic Format\Slide 3 of Annual Sales", "JPG"
End With