ChartSheetBase.PrintOut 方法

打印 Microsoft.Office.Tools.Excel.ChartSheetBase

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

语法

声明
Public Sub PrintOut ( _
    from As Object, _
    to As Object, _
    copies As Object, _
    preview As Object, _
    activePrinter As Object, _
    printToFile As Object, _
    collate As Object, _
    prToFileName As Object _
)
public void PrintOut(
    Object from,
    Object to,
    Object copies,
    Object preview,
    Object activePrinter,
    Object printToFile,
    Object collate,
    Object prToFileName
)

参数

  • from
    类型:System.Object
    要打印的第一页的页码。如果省略此参数,则打印从第一页开始。
  • to
    类型:System.Object
    要打印的最后一页的页码。如果省略此参数,则打印完最后一页后停止打印。
  • copies
    类型:System.Object
    要打印的份数。如果省略此参数,则打印一份副本。
  • preview
    类型:System.Object
    为 true 时,Microsoft Office Excel 在打印对象之前调用打印预览。为 false(或省略)时,立即打印对象。
  • activePrinter
    类型:System.Object
    设置活动打印机的名称。
  • printToFile
    类型:System.Object
    为 true 时打印到文件。如果未指定 PrToFileName,则 Excel 将提示用户输入输出文件的名称。
  • collate
    类型:System.Object
    如果为 true,则逐份打印多个副本。
  • prToFileName
    类型:System.Object
    如果 PrintToFile 设置为 true,则此参数指定要打印到的文件的名称。

备注

From 和 To 的说明中的“页”指打印页;而不是工作表或工作簿中的所有页。

可选参数

有关可选参数的信息,请参见Office 解决方案中的可选参数

示例

下面的代码示例使用 PrintOut 方法打印当前 Microsoft.Office.Tools.Excel.ChartSheetBase 的两个副本。

Private Sub PrintChartSheet()
    Globals.Sheet1.Range("A1", "A5").Value2 = 22
    Globals.Sheet1.Range("B1", "B5").Value2 = 55

    Me.SetSourceData(Globals.Sheet1.Range("A1", "B5"), _
        Excel.XlRowCol.xlColumns)
    Me.ChartType = Excel.XlChartType.xl3DColumn

    Me.PrintOut(Copies:=2, Preview:=True, PrintToFile:=False, _
        Collate:=False)
End Sub
private void PrintChartSheet()
{
    Globals.Sheet1.Range["A1", "A5"].Value2 = 22;
    Globals.Sheet1.Range["B1", "B5"].Value2 = 55;

    this.SetSourceData(Globals.Sheet1.Range["A1", "B5"],
        Excel.XlRowCol.xlColumns);
    this.ChartType = Excel.XlChartType.xl3DColumn;

    this.PrintOut(missing, missing, 2, true, missing, false, 
        false, missing);
}

.NET Framework 安全性

请参见

参考

ChartSheetBase 类

Microsoft.Office.Tools.Excel 命名空间