編輯

共用方式為


_Workbook.ExportAsFixedFormat Method

Definition

The ExportAsFixedFormat(XlFixedFormatType, Object, Object, Object, Object, Object, Object, Object, Object) method is used to publish a workbook to either the PDF or XPS format.

public void ExportAsFixedFormat (Microsoft.Office.Interop.Excel.XlFixedFormatType Type, object Filename, object Quality, object IncludeDocProperties, object IgnorePrintAreas, object From, object To, object OpenAfterPublish, object FixedFormatExtClassPtr);
Public Sub ExportAsFixedFormat (Type As XlFixedFormatType, Optional Filename As Object, Optional Quality As Object, Optional IncludeDocProperties As Object, Optional IgnorePrintAreas As Object, Optional From As Object, Optional To As Object, Optional OpenAfterPublish As Object, Optional FixedFormatExtClassPtr As Object)

Parameters

Type
XlFixedFormatType

Can be either xlTypePDF or xlTypeXPS.

Filename
Object

A String that indicates the name of the file to be saved. You can include a full path or short. Excel2007 saves the file in the current folder.

Quality
Object

Can be set to either xlQualityStandard or xlQualityMinimum.

IncludeDocProperties
Object

Set to True to indicate that document properties should be included or set to False to indicate that they are omitted.

IgnorePrintAreas
Object

If set to True, ignores any print areas set when publishing. If set to False, will use the print areas set when publishing.

From
Object

The number of the page at which to start publishing. If this argument is omitted, publishing starts at the beginning.

To
Object

The number of the last page to publish. If this argument is omitted, publishing ends with the last page

OpenAfterPublish
Object

If set to True displays file in viewer after it is published. If set to False the file is published but not displayed.

FixedFormatExtClassPtr
Object

Pointer to the FixedFormatExt class.

Examples

The following example creates the PDF at standard quality in the current file’s directory and displays file in viewer after it is published.

Note: An error will occur if the PDF add-in is not currently installed.

Applies to