XmlMappedRange.ExportAsFixedFormat 方法

导出到指定格式的文件。

命名空间:  Microsoft.Office.Tools.Excel
程序集:  Microsoft.Office.Tools.Excel(在 Microsoft.Office.Tools.Excel.dll 中)

语法

声明
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
)

参数

  • Filename
    类型:System.Object
    一个包含要保存文件的文件名的字符串。可以包含完整路径;否则,Excel 会将文件保存在当前文件夹中。
  • Quality
    类型:System.Object
    Microsoft.Office.Interop.Excel.XlFixedFormatQuality 值之一,指定导出文件的质量。
  • IncludeDocProperties
    类型:System.Object
    若包含文档属性,则为 true;否则为 false。
  • IgnorePrintAreas
    类型:System.Object
    如果要在导出时忽略所有打印区域设置,则为 true;否则为 false。
  • From
    类型:System.Object
    要导出的起始页的页码。如果省略此参数,则从第一页开始导出。
  • To
    类型:System.Object
    要导出的最后一页的页码。如果省略此参数,则导出完最后一页后停止导出。
  • OpenAfterPublish
    类型:System.Object
    如果要在文件发布后在查看器中显示文件,则为 true;否则为 false。
  • FixedFormatExtClassPtr
    类型:System.Object
    一个指针,指向使工作簿能够以其他固定格式保存的 IMsoDocExporter 接口的实现。有关更多信息,请参见“扩展 Office (2007) 固定格式导出功能”。

备注

此方法还支持通过初始化外接程序将文件导出到固定格式的文件。 例如,如果存在转换器,则 Excel 将执行文件格式转换。 转换通常由用户发起。

示例

下面的代码示例设置 EmployeeNameCell 的值。 Sheet1 上的 XmlMappedRange 控件。 接着,该示例将 EmployeeSeniorityCell 的内容导出到指定文件夹中具有指定文件名的 PDF 文档中。

提示

通常,您会填充 XML 文件中的 XmlMappedRange 控件。 为了简便起见,此示例对该控件的值进行硬编码。

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,
        missing);
}

.NET Framework 安全性

请参见

参考

XmlMappedRange 接口

Microsoft.Office.Tools.Excel 命名空间