0 out of 1 rated this helpful - Rate this topic

Document.ExportAsFixedFormat Method

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

Version Information
 Version Added:  Visio 2007

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

NameRequired/OptionalData TypeDescription
FixedFormatRequiredVisFixedFormatTypesThe format type in which to export the document. See Remarks for possible values.
OutputFileNameOptionalStringThe name and path of the file to which to output, enclosed in quotation marks.
IntentRequiredVisDocExIntentThe output quality. See Remarks for possible values.
PrintRangeRequiredVisPrintOutRangeThe range of document pages to be exported. See Remarks for possible values.
FromPageOptionalLong 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.
ToPageOptionalLongIf PrintRange is visPrintFromTo , the last page in the range to be exported. The default is -1, which indicates the last page of the drawing.
ColorAsBlackOptionalBooleanTrue 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.
IncludeBackgroundOptionalBooleanWhether to include background pages in the exported file. The default is True.
IncludeDocumentPropertiesOptionalBooleanWhether to include document properties in the exported file. The default is True.
IncludeStructureTagsOptionalBooleanWhether to include document structure tags to improve document accessibility. The default is True.
UseISO19005_1OptionalBooleanWhether the resulting document is compliant with ISO 19005-1 (PDF/A). The default is False.
FixedFormatExtClassOptional[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 is the equivalent of the Publish As PDF or XPS command on the File menu in the Visio user interface. The method creates a file that contains a static view of the Visio document.

ms409271.vs_note(en-us,office.12).gif  Note
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.

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

ConstantValueDescription

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.

ConstantValueDescription

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.

ConstantValueDescription

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.

Visual Basic for Applications
Public Sub ExportAsFixedFormat_Example()

    ActiveDocument.ExportAsFixedFormat visFixedFormatPDF, "C:\ExportedVisioDocument.pdf", visDocExIntentPrint, visPrintAll

End Sub



Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.