Muokkaa

Jaa


Document.ExportAsFixedFormat2 method (Word)

Saves a document in PDF or XPS format.

Syntax

expression.ExportAsFixedFormat2 (OutputFileName, ExportFormat, OpenAfterExport, OptimizeFor, Range, From, To, Item, IncludeDocProps, KeepIRM, CreateBookmarks, DocStructureTags, BitmapMissingFonts, UseISO19005_1, OptimizeForImageQuality, FixedFormatExtClassPtr)

expression An expression that returns a Document object.

Parameters

Name Required/Optional Data type Description
OutputFileName Required String The path and file name of the new PDF or XPS file.
ExportFormat Required WdExportFormat Specifies either PDF or XPS format.
OpenAfterExport Optional Boolean Opens the new file after exporting the contents.
OptimizeFor Optional WdExportOptimizeFor Specifies whether to optimize for screen or print.
Range Optional WdExportRange Specifies whether the export range is the entire document, the current page, a range of text, or the current selection. The default is to export the entire document.
From Optional Long Specifies the starting page number, if the Range parameter is set to wdExportFromTo.
To Optional Long Specifies the ending page number, if the Range parameter is set to wdExportFromTo.
Item Optional WdExportItem Specifies whether the export process includes text only or includes text with markup.
IncludeDocProps Optional Boolean Specifies whether to include document properties in the newly exported file.
KeepIRM Optional Boolean Specifies whether to copy IRM permissions to an XPS document if the source document has IRM protections.

If ExportFormat is wdExportFormatPDF, this flag also specifies whether to copy labels to the PDF.

Default value is True.
CreateBookmarks Optional WdExportCreateBookmarks Specifies whether to export bookmarks and the type of bookmarks to export.
DocStructureTags Optional Boolean Specifies whether to include extra data to help screen readers, for example information about the flow and logical organization of the content. Default value is True.
BitmapMissingFonts Optional Boolean Specifies whether to include a bitmap of the text. Set this parameter to True when font licenses don't permit a font to be embedded in the PDF file. If False, the font is referenced, and the viewer's computer substitutes an appropriate font if the authored one is not available. Default value is True.
UseISO19005_1 Optional Boolean Specifies whether to limit PDF usage to the PDF subset standardized as ISO 19005-1. If True, the resulting files are more reliably self-contained but may be larger or show more visual artifacts due to the restrictions of the format. Default value is False.
OptimizeForImageQuality Optional Boolean Specifies whether to downsample images or keep their original quality. If True, the resulting files will have better image quality but may be larger. Default value is False.
FixedFormatExtClassPtr Optional Variant Specifies a pointer to an add-in that allows calls to an alternate implementation of code. The alternate implementation of code interprets the EMF and EMF+ page descriptions that are generated by the applications to make their own PDF or XPS. For more information, see Extend the fixed-format export feature in Word Automation Services.

Remarks

The KeepIRM parameter behaves specially for PDF. It controls the retention of both labels and encryption to the output file. For more information, see Manage sensitivity labels in Office apps.

See also

Manage sensitivity labels in Office apps

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.