共用方式為


ChartSheet.CopyPicture 方法

Microsoft.Office.Tools.Excel.ChartSheet 以圖片形式複製到 [剪貼簿] 中。

命名空間:  Microsoft.Office.Tools.Excel
組件:   Microsoft.Office.Tools.Excel.v4.0.Utilities (在 Microsoft.Office.Tools.Excel.v4.0.Utilities.dll 中)
  Microsoft.Office.Tools.Excel (在 Microsoft.Office.Tools.Excel.dll 中)

語法

'宣告
Sub CopyPicture ( _
    Appearance As XlPictureAppearance, _
    Format As XlCopyPictureFormat, _
    Size As XlPictureAppearance _
)
void CopyPicture(
    XlPictureAppearance Appearance,
    XlCopyPictureFormat Format,
    XlPictureAppearance Size
)

參數

備註

選擇性參數

如需選擇性參數的詳細資訊,請參閱Office 方案中的選擇性參數

範例

下列程式碼範例會使用 CopyPicture 方法,將目前的 Microsoft.Office.Tools.Excel.ChartSheet 以點陣圖複製到剪貼簿。

Private Sub CopyChartSheetAsBitmap()
    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.xlColumnClustered

    Me.CopyPicture(Excel.XlPictureAppearance.xlScreen, _
        Excel.XlCopyPictureFormat.xlBitmap, _
        Excel.XlPictureAppearance.xlScreen)
End Sub
private void CopyChartSheetAsBitmap()
{
    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.xlColumnClustered;

    this.CopyPicture(Excel.XlPictureAppearance.xlScreen,
        Excel.XlCopyPictureFormat.xlBitmap,
        Excel.XlPictureAppearance.xlScreen);
}

.NET Framework 安全性

請參閱

參考

ChartSheet 介面

Microsoft.Office.Tools.Excel 命名空間