_Document.ExportAsFixedFormat Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Saves a document as 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, Microsoft.Office.Interop.Word.WdExportRange Range = Microsoft.Office.Interop.Word.WdExportRange.wdExportAllDocument, int From = 1, int To = 1, Microsoft.Office.Interop.Word.WdExportItem Item = Microsoft.Office.Interop.Word.WdExportItem.wdExportDocumentContent, bool IncludeDocProps = false, bool KeepIRM = false, Microsoft.Office.Interop.Word.WdExportCreateBookmarks CreateBookmarks = Microsoft.Office.Interop.Word.WdExportCreateBookmarks.wdExportCreateNoBookmarks, bool DocStructureTags = false, bool BitmapMissingFonts = false, bool UseISO19005_1 = false, ref object FixedFormatExtClassPtr);
abstract member ExportAsFixedFormat : string * Microsoft.Office.Interop.Word.WdExportFormat * bool * Microsoft.Office.Interop.Word.WdExportOptimizeFor * Microsoft.Office.Interop.Word.WdExportRange * int * int * 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 Range As WdExportRange = Microsoft.Office.Interop.Word.WdExportRange.wdExportAllDocument, Optional From As Integer = 1, Optional To As Integer = 1, Optional Item As WdExportItem = Microsoft.Office.Interop.Word.WdExportItem.wdExportDocumentContent, Optional IncludeDocProps As Boolean = false, Optional KeepIRM As Boolean = false, Optional CreateBookmarks As WdExportCreateBookmarks = Microsoft.Office.Interop.Word.WdExportCreateBookmarks.wdExportCreateNoBookmarks, Optional DocStructureTags As Boolean = false, Optional BitmapMissingFonts As Boolean = false, Optional UseISO19005_1 As Boolean = false, Optional ByRef FixedFormatExtClassPtr As Object)
Parameters
- OutputFileName
- String
The path and file name name of the new PDF or XPS file.
- ExportFormat
- WdExportFormat
Specifies either PDF or XPS format.
- OpenAfterExport
- Boolean
Opens the new file after exporting the contents.
- OptimizeFor
- WdExportOptimizeFor
Specifies whether to optimize for screen or print.
- Range
- 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
- Int32
Specifies the starting page number, if the Range
parameter is set to wdExportFromTo.
- To
- Int32
Specifies the ending page number, if the Range
parameter is set to wdExportFromTo.
- Item
- WdExportItem
Specifies whether the export process includes text only or includes text with markup.
- IncludeDocProps
- Boolean
Specifies whether to include document properties in the newly exported file.
- KeepIRM
- Boolean
Specifies whether to copy IRM permissions to an XPS document if the source document has IRM protections. Default value is True.
- CreateBookmarks
- WdExportCreateBookmarks
Specifies whether to export bookmarks and the type of bookmarks to export.
- DocStructureTags
- 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
- Boolean
Specifies whether to include a bitmap of the text. Set this parameter to True when font licenses do not 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
- 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.
- FixedFormatExtClassPtr
- Object
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 "Extending the Office (2007) Fixed-Format Export Feature" on MSDN.
Remarks
You can save as a PDF or XPS file from a 2007 Microsoft Office system program 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.