Bookmark.ExportAsFixedFormat Method

Definition

Saves the Bookmark in PDF or XPS format.

public void ExportAsFixedFormat (string OutputFileName, Microsoft.Office.Interop.Word.WdExportFormat ExportFormat, bool OpenAfterExport = false, Microsoft.Office.Interop.Word.WdExportOptimizeFor OptimizeFor = Microsoft.Office.Interop.Word.WdExportOptimizeFor.wdExportOptimizeForPrint, bool ExportCurrentPage = false, Microsoft.Office.Interop.Word.WdExportItem Item = Microsoft.Office.Interop.Word.WdExportItem.wdExportDocumentContent, bool IncludeDocProps = false, bool KeepIRM = true, Microsoft.Office.Interop.Word.WdExportCreateBookmarks CreateBookmarks = Microsoft.Office.Interop.Word.WdExportCreateBookmarks.wdExportCreateNoBookmarks, bool DocStructureTags = true, bool BitmapMissingFonts = true, bool UseISO19005_1 = false, ref object FixedFormatExtClassPtr);
abstract member ExportAsFixedFormat : string * Microsoft.Office.Interop.Word.WdExportFormat * bool * Microsoft.Office.Interop.Word.WdExportOptimizeFor * bool * Microsoft.Office.Interop.Word.WdExportItem * bool * bool * Microsoft.Office.Interop.Word.WdExportCreateBookmarks * bool * bool * bool * obj -> unit
Public Sub ExportAsFixedFormat (OutputFileName As String, ExportFormat As WdExportFormat, Optional OpenAfterExport As Boolean = false, Optional OptimizeFor As WdExportOptimizeFor = Microsoft.Office.Interop.Word.WdExportOptimizeFor.wdExportOptimizeForPrint, Optional ExportCurrentPage As Boolean = false, Optional Item As WdExportItem = Microsoft.Office.Interop.Word.WdExportItem.wdExportDocumentContent, Optional IncludeDocProps As Boolean = false, Optional KeepIRM As Boolean = true, Optional CreateBookmarks As WdExportCreateBookmarks = Microsoft.Office.Interop.Word.WdExportCreateBookmarks.wdExportCreateNoBookmarks, Optional DocStructureTags As Boolean = true, Optional BitmapMissingFonts As Boolean = true, Optional UseISO19005_1 As Boolean = false, Optional ByRef FixedFormatExtClassPtr As Object)

Parameters

OutputFileName
String

The full path of the new PDF or XPS file.

ExportFormat
WdExportFormat

One of the WdExportFormat values that specifies whether to save the Bookmark in PDF or XPS format.

OpenAfterExport
Boolean

true to open the new file after exporting the Bookmark; otherwise, false.

OptimizeFor
WdExportOptimizeFor

One of the WdExportOptimizeFor values that specifies whether to optimize for screen or print.

ExportCurrentPage
Boolean

true to export the entire page; false to export only the current selection.

Item
WdExportItem

One of the WdExportItem values that specifies whether the export process includes text only or includes text with markup.

IncludeDocProps
Boolean

true to include document properties in the newly exported file; otherwise, false.

KeepIRM
Boolean

true to copy Information Rights Management (IRM) permissions to an XPS document if the source document has IRM protections; otherwise, false. The default is true.

CreateBookmarks
WdExportCreateBookmarks

One of the WdExportCreateBookmarks values that specifies whether to export bookmarks and the type of bookmarks to export.

DocStructureTags
Boolean

true to include extra data to help screen readers, such as information about the flow and logical organization of the content; otherwise, false. The default is true.

BitmapMissingFonts
Boolean

true to include a bitmap of the text; false to reference the text font. Set this parameter to true when font licenses do not permit a font to be embedded in the PDF file. If you set this to false, the viewer's computer substitutes an appropriate font if the specified one is not available. The default is true.

UseISO19005_1
Boolean

true to limit PDF usage to the PDF subset standardized as ISO 19005-1; otherwise, false. If you set this parameter to 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. The default is false.

FixedFormatExtClassPtr
Object

A pointer to an implementation of the IMsoDocExporter interface that enables the bookmark to be saved in a different fixed format. For more information, see Extending the Office (2007) Fixed-Format Export Feature.

Remarks

You can save as a PDF or XPS file from Word only after you install an add-in. For more information, search for "Enable support for other file formats, such as PDF and XPS" on Office Online.

Applies to