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

This page presents procedures from class Presentation related to the theme Import/Export: Export, ExportAsFixedFormat and ExportAsFixedFormat2

Export

Exports each slide in the presentation, using the specified graphics filter, and saves the exported files in the specified folder.

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 by using names such as Slide1.wmf, Slide2.wmf. The path of the saved files is specified in the Path argument.

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

With ActivePresentation
    .SaveAs FileName:="c:\Current Work\Annual Sales", _
        FileFormat:=ppSaveAsPresentation
    .Export Path:="c:\Current Work", FilterName:="png", _
        ScaleWidth:=100, ScaleHeight:=100
End With

Arguments

The following arguments are required:

Path (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, Microsoft PowerPoint creates a subfolder in the current folder for the exported slides.

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. 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.

ExportAsFixedFormat

Publishes a copy of a Microsoft PowerPoint presentation as a file in a fixed format, either PDF or XPS.

The ExportAsFixedFormat method is the equivalent of the Save As PDF or XPS command on the Office menu in the PowerPoint user interface. The method creates a file that contains a static view of the active presentation. The FixedFormatType parameter value can be one of these PpFixedFormatType constants.

Syntax : expression.ExportAsFixedFormat (Path, FixedFormatType, Intent, FrameSlides, HandoutOrder, OutputType, PrintHiddenSlides, PrintRange, RangeType, SlideShowName, IncludeDocProperties, KeepIRMSettings, DocStructureTags, BitmapMissingFonts, UseISO19005_1, ExternalExporter)

Public Sub ExportAsFixedFormat_Example() 
 
       ActivePresentation.ExportAsFixedFormat "C:\Users\username \Documents\test.pdf", ppFixedFormatTypePDF, ppFixedFormatIntentScreen, msoCTrue, ppPrintHandoutHorizontalFirst, ppPrintOutputBuildSlides, msoFalse, , , , False, False, False, False, False 
 
End Sub

Arguments

The following arguments are required:

Path (String) - The path for the export.

FixedFormatType (PpFixedFormatType) - The format to which the slides should be exported.

Possible Values are ppFixedFormatTypePDF - PDF format, ppFixedFormatTypeXPS - XPS format.

The following arguments are optional

Intent (PpFixedFormatIntent) - The purpose of the export.

Possible Values are ppFixedFormatIntentPrint - Intent is to print exported file, ppFixedFormatIntentScreen - Intent is to view exported file on screen.

FrameSlides (Office.MsoTriState) - Whether the slides to be exported should be bordered by a frame.

HandoutOrder (PpPrintHandoutOrder) - The order in which the handout should be printed.

Possible Values are ppPrintHandoutHorizontalFirst - Slides are ordered horizontally, with the first slide in the upper-left corner and the second slide to the right of it. If your language setting specifies a right-to-left language, the first slide is in the upper-right corner with the second slide to the left of it, ppPrintHandoutVerticalFirst - Slides are ordered vertically, with the first slide in the upper-left corner and the second slide below it. If your language setting specifies a right-to-left language, the first slide is in the upper-right corner with the second slide below it.

OutputType (PpPrintOutputType) - The type of output.

Here you can find possible values for PpPrintOutputType.

PrintHiddenSlides (Office.MsoTriState) - Whether to print hidden slides.

PrintRange (PrintRange) - The slide range.

RangeType (PpPrintRangeType) - The type of slide range.

Possible Values are

ppPrintAll Print all slides in the presentation.
ppPrintCurrent Print the current slide from the presentation.
ppPrintNamedSlideShow Print a named slideshow.
ppPrintSection
ppPrintSelection Print a selection of slides.
ppPrintSlideRange Print a range of slides.

SlideShowName (String) - The name of the slide show.

IncludeDocProperties (Boolean) - Whether the document properties should also be exported. The default is False.

KeepIRMSettings (Boolean) - Whether the IRM settings should also be exported. The default is True.

DocStructureTags (Boolean) - Whether to include document structure tags to improve document accessibility. The default is True.

BitmapMissingFonts (Boolean) - Whether to include a bitmap of the text. The default is True.

UseISO19005_1 (Boolean) - Whether the resulting document is compliant with ISO 19005-1 (PDF/A). The default is False.

ExternalExporter - A pointer to an Office add-in that implements the IMsoDocExporter COM interface and allows calls to an alternate implementation of code. The default is a null pointer

ExportAsFixedFormat2

Publishes a copy of a Microsoft PowerPoint presentation as a file in a fixed format, either PDF or XPS.

Syntax : expression.ExportAsFixedFormat2 (Path, FixedFormatType, Intent, FrameSlides, HandoutOrder, OutputType, PrintHiddenSlides, PrintRange, RangeType, SlideShowName, IncludeDocProperties, KeepIRMSettings, DocStructureTags, BitmapMissingFonts, UseISO19005_1, IncludeMarkup, ExternalExporter)

Dim strPath As String: strPath = 
ActivePresentation.ExportAsFixedFormat2 Path:=strPath, FixedFormatType:=ppFixedFormatTypePDF

Arguments

The following arguments are required:

Path (String) - The path for the export.

FixedFormatType (PpFixedFormatType) - The format to which the slides should be exported.

Possible Values are ppFixedFormatTypePDF - PDF format, ppFixedFormatTypeXPS - XPS format.

The following arguments are optional

Intent (PpFixedFormatIntent) - The purpose of the export.

Possible Values are ppFixedFormatIntentPrint - Intent is to print exported file, ppFixedFormatIntentScreen - Intent is to view exported file on screen.

FrameSlides (Office.MsoTriState) - Whether the slides to be exported should be bordered by a frame.

HandoutOrder (PpPrintHandoutOrder) - The order in which the handout should be printed.

Possible Values are ppPrintHandoutHorizontalFirst - Slides are ordered horizontally, with the first slide in the upper-left corner and the second slide to the right of it. If your language setting specifies a right-to-left language, the first slide is in the upper-right corner with the second slide to the left of it, ppPrintHandoutVerticalFirst - Slides are ordered vertically, with the first slide in the upper-left corner and the second slide below it. If your language setting specifies a right-to-left language, the first slide is in the upper-right corner with the second slide below it.

OutputType (PpPrintOutputType) - The type of output.

Here you can find possible values for PpPrintOutputType.

PrintHiddenSlides (Office.MsoTriState) - Whether to print hidden slides.

PrintRange (PrintRange) - The slide range.

RangeType (PpPrintRangeType) - The type of slide range.

Possible Values are

ppPrintAll Print all slides in the presentation.
ppPrintCurrent Print the current slide from the presentation.
ppPrintNamedSlideShow Print a named slideshow.
ppPrintSection
ppPrintSelection Print a selection of slides.
ppPrintSlideRange Print a range of slides.

SlideShowName (String) - The name of the slide show.

IncludeDocProperties (Boolean) - Whether the document properties should also be exported. The default is False.

KeepIRMSettings (Boolean) - Whether the IRM settings should also be exported. The default is True.

DocStructureTags (Boolean) - Whether to include document structure tags to improve document accessibility. The default is True.

BitmapMissingFonts (Boolean) - Whether to include a bitmap of the text. The default is True.

UseISO19005_1 (Boolean) - Whether the resulting document is compliant with ISO 19005-1 (PDF/A). The default is False.

IncludeMarkup (Boolean) - Whether the resulting document should include associated pen marks.

ExternalExporter - A pointer to an Office add-in that implements the IMsoDocExporter COM interface and allows calls to an alternate implementation of code. The default is a null pointer