_Document.ExportAsFixedFormat Method

Saves a document as PDF or XPS format.

Namespace:  Microsoft.Office.Interop.Word
Assembly:  Microsoft.Office.Interop.Word (in Microsoft.Office.Interop.Word.dll)

Syntax

'Declaration
Sub ExportAsFixedFormat ( _
    OutputFileName As String, _
    ExportFormat As WdExportFormat, _
    OpenAfterExport As Boolean, _
    OptimizeFor As WdExportOptimizeFor, _
    Range As WdExportRange, _
    From As Integer, _
    To As Integer, _
    Item As WdExportItem, _
    IncludeDocProps As Boolean, _
    KeepIRM As Boolean, _
    CreateBookmarks As WdExportCreateBookmarks, _
    DocStructureTags As Boolean, _
    BitmapMissingFonts As Boolean, _
    UseISO19005_1 As Boolean, _
    ByRef FixedFormatExtClassPtr As Object _
)
'Usage
Dim instance As _Document
Dim OutputFileName As String
Dim ExportFormat As WdExportFormat
Dim OpenAfterExport As Boolean
Dim OptimizeFor As WdExportOptimizeFor
Dim Range As WdExportRange
Dim From As Integer
Dim To As Integer
Dim Item As WdExportItem
Dim IncludeDocProps As Boolean
Dim KeepIRM As Boolean
Dim CreateBookmarks As WdExportCreateBookmarks
Dim DocStructureTags As Boolean
Dim BitmapMissingFonts As Boolean
Dim UseISO19005_1 As Boolean
Dim FixedFormatExtClassPtr As Object

instance.ExportAsFixedFormat(OutputFileName, _
    ExportFormat, OpenAfterExport, OptimizeFor, _
    Range, From, To, Item, IncludeDocProps, _
    KeepIRM, CreateBookmarks, DocStructureTags, _
    BitmapMissingFonts, UseISO19005_1, _
    FixedFormatExtClassPtr)
void ExportAsFixedFormat(
    string OutputFileName,
    WdExportFormat ExportFormat,
    bool OpenAfterExport,
    WdExportOptimizeFor OptimizeFor,
    WdExportRange Range,
    int From,
    int To,
    WdExportItem Item,
    bool IncludeDocProps,
    bool KeepIRM,
    WdExportCreateBookmarks CreateBookmarks,
    bool DocStructureTags,
    bool BitmapMissingFonts,
    bool UseISO19005_1,
    ref Object FixedFormatExtClassPtr
)

Parameters

  • OutputFileName
    Type: System.String
    The path and file name name of the new PDF or XPS file.
  • OpenAfterExport
    Type: System.Boolean
    Opens the new file after exporting the contents.
  • Range
    Type: Microsoft.Office.Interop.Word.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.
  • IncludeDocProps
    Type: System.Boolean
    Specifies whether to include document properties in the newly exported file.
  • KeepIRM
    Type: System.Boolean
    Specifies whether to copy IRM permissions to an XPS document if the source document has IRM protections. Default value is True.
  • DocStructureTags
    Type: System.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
    Type: System.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
    Type: System.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
    Type: System.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.

See Also

Reference

_Document Interface

_Document Members

Microsoft.Office.Interop.Word Namespace