Document.ExportAsFixedFormat method (Visio)

Exports a Microsoft Visio document as a file in a fixed format, either PDF or XPS.

Syntax

expression.ExportAsFixedFormat (FixedFormat, OutputFileName, Intent, PrintRange, FromPage, ToPage, ColorAsBlack, IncludeBackground, IncludeDocumentProperties, IncludeStructureTags, UseISO19005_1, FixedFormatExtClass)

expression An expression that returns a Document object.

Parameters

Name Required/Optional Data type Description
FixedFormat Required VisFixedFormatTypes The format type in which to export the document. See Remarks for possible values.
OutputFileName Optional String The name and path of the file to which to output, enclosed in quotation marks.
Intent Required VisDocExIntent The output quality. See Remarks for possible values.
PrintRange Required VisPrintOutRange The range of document pages to be exported. See Remarks for possible values.
FromPage Optional Long If PrintRange is visPrintFromTo, the first page in the range to be exported. The default is 1, which indicates the first page of the drawing.
ToPage Optional Long If PrintRange is visPrintFromTo, the last page in the range to be exported. The default is -1, which indicates the last page of the drawing.
ColorAsBlack Optional Boolean True to render all colors as black to ensure that all shapes are visible in the exported drawing. False to render colors normally. The default is False.
IncludeBackground Optional Boolean Whether to include background pages in the exported file. The default is True.
IncludeDocumentProperties Optional Boolean Whether to include document properties in the exported file. The default is True.
IncludeStructureTags Optional Boolean Whether to include document structure tags to improve document accessibility. The default is True.
UseISO19005_1 Optional Boolean Whether the resulting document is compliant with ISO 19005-1 (PDF/A). The default is False.
FixedFormatExtClass Optional [UNKNOWN] A pointer to a class that implements the IMsoDocExporter interface for purposes of creating custom fixed output. The default is a null pointer.

Return value

Nothing

Remarks

The ExportAsFixedFormat method creates a file that contains a static view of the Visio document.

Possible values for the FixedFormat parameter are shown in the following table and declared in VisFixedFormatTypes in the Visio type library.

Constant Value Description
visFixedFormatPDF 1 PDF fixed format
visFixedFormatXPS 2 XPS fixed format

Possible values for the Intent parameter are shown in the following table and declared in VisDocExIntent in the Visio type library.

Constant Value Description
visDocExIntentPrint 1 Intended to be published online and printed
visDocExIntentScreen 0 Intended to be published only online

Possible values for the PrintRange parameter are shown in the following table and declared in VisPrintOutRange in the Visio type library.

Constant Value Description
visPrintAll 0 Prints all foreground pages.
visPrintCurrentPage 2 Prints the active page.
visPrintCurrentView 4 Prints the current view area.
visPrintFromTo 1 Prints pages between the FromPage value and the ToPage value.
visPrintSelection 3 Prints a selection.

Example

The following Microsoft Visual Basic for Applications (VBA) macro shows how to use the ExportAsFixedFormat method to export the active Visio document to the root of the C drive in PDF format.

Public Sub ExportAsFixedFormat_Example() 
 
    ActiveDocument.ExportAsFixedFormat visFixedFormatPDF, "C:\ExportedVisioDocument .pdf", visDocExIntentPrint, visPrintAll 
 
End Sub

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.