共用方式為


XmlMappedRange.ExportAsFixedFormat Method

Exports to a file of the specified format.

Namespace:  Microsoft.Office.Tools.Excel
Assembly:  Microsoft.Office.Tools.Excel (in Microsoft.Office.Tools.Excel.dll)

Syntax

'Declaration
Sub ExportAsFixedFormat ( _
    Type As XlFixedFormatType, _
    Filename As Object, _
    Quality As Object, _
    IncludeDocProperties As Object, _
    IgnorePrintAreas As Object, _
    From As Object, _
    To As Object, _
    OpenAfterPublish As Object, _
    FixedFormatExtClassPtr As Object _
)
void ExportAsFixedFormat(
    XlFixedFormatType Type,
    Object Filename,
    Object Quality,
    Object IncludeDocProperties,
    Object IgnorePrintAreas,
    Object From,
    Object To,
    Object OpenAfterPublish,
    Object FixedFormatExtClassPtr
)

Parameters

  • Filename
    Type: System.Object

    A string that contains the file name of the file to be saved. You can include a full path, or Excel saves the file in the current folder.

  • Quality
    Type: System.Object

    One of the Microsoft.Office.Interop.Excel.XlFixedFormatQuality values that specifies the quality of the exported file.

  • IncludeDocProperties
    Type: System.Object

    true to include the document properties; otherwise, false.

  • IgnorePrintAreas
    Type: System.Object

    true to ignore any print areas set when exporting; otherwise, false.

  • From
    Type: System.Object

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

  • To
    Type: System.Object

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

  • OpenAfterPublish
    Type: System.Object

    true to display the file in the viewer after it is published; otherwise, false.

  • FixedFormatExtClassPtr
    Type: System.Object

    A pointer to an implementation of the IMsoDocExporter interface that enables the workbook to be saved in a different fixed format. For more information, see Extending the Office (2007) Fixed-Format Export Feature.

Remarks

This method also supports initializing an add-in to export a file to a fixed-format file. For example, Excel will perform file format conversion if the converters are present. The conversion is usually initiated by the user.

Examples

The following code example sets the value of the EmployeeNameCellXmlMappedRange control on Sheet1. Next, the example exports the contents of EmployeeSeniorityCell into a PDF document to the specified folder and file name.

Note

Typically, you populate the XmlMappedRange control from an XML file. This example hard-codes the value of the control for simplicity.

Private Sub SaveXMLMappedRangeAsPDF()
    Globals.Sheet1.EmployeeNameCell.Value2 = "Karina Leal"

    Globals.Sheet1.EmployeeNameCell.ExportAsFixedFormat( _
        Excel.XlFixedFormatType.xlTypePDF, _
        "c:\EmployeeInfo", _
        Excel.XlFixedFormatQuality.xlQualityStandard, _
        True, _
        True, _
        1, _
        1, _
        False)
End Sub
private void SaveXMLMappedRangeAsPDF()
{
    Globals.Sheet1.EmployeeNameCell.Value2 = "Karina Leal";

    Globals.Sheet1.EmployeeNameCell.ExportAsFixedFormat(
        Excel.XlFixedFormatType.xlTypePDF,
        @"c:\EmployeeInfo",
        Excel.XlFixedFormatQuality.xlQualityStandard,
        true,
        true,
        1,
        1,
        false);
}

.NET Framework Security

See Also

Reference

XmlMappedRange Interface

Microsoft.Office.Tools.Excel Namespace