共用方式為


XmlMappedRange.CopyPicture(XlPictureAppearance, XlCopyPictureFormat) 方法

定義

XmlMappedRange 控制項以圖片形式複製到 [剪貼簿]。

public object CopyPicture (Microsoft.Office.Interop.Excel.XlPictureAppearance Appearance = Microsoft.Office.Interop.Excel.XlPictureAppearance.xlScreen, Microsoft.Office.Interop.Excel.XlCopyPictureFormat Format = Microsoft.Office.Interop.Excel.XlCopyPictureFormat.xlPicture);
abstract member CopyPicture : Microsoft.Office.Interop.Excel.XlPictureAppearance * Microsoft.Office.Interop.Excel.XlCopyPictureFormat -> obj
Public Function CopyPicture (Optional Appearance As XlPictureAppearance = Microsoft.Office.Interop.Excel.XlPictureAppearance.xlScreen, Optional Format As XlCopyPictureFormat = Microsoft.Office.Interop.Excel.XlCopyPictureFormat.xlPicture) As Object

參數

Appearance
XlPictureAppearance

指定圖片的複製方式。可以為下列 XlPictureAppearance 其中一個常數: xlPrinterxlScreen

Format
XlCopyPictureFormat

圖片的格式。可以為下列 XlCopyPictureFormat 其中一個常數: xlBitmapxlPicture

傳回

範例

下列程式代碼範例會 CopyPicture 使用 方法,將 複製到 XmlMappedRange 剪貼簿做為位圖。 這個程式代碼範例假設目前的工作表包含 XmlMappedRange 名為 CustomerLastNameCell的 。

private void CopyAsBitmap()
{
    this.CustomerLastNameCell.Value2 = "Smith";
    this.CustomerLastNameCell.CopyPicture(
        Excel.XlPictureAppearance.xlScreen, 
        Excel.XlCopyPictureFormat.xlBitmap);
}
Private Sub CopyAsBitmap()
    Me.CustomerLastNameCell.Value2 = "Smith"
    Me.CustomerLastNameCell.CopyPicture( _
        Excel.XlPictureAppearance.xlScreen, Excel.XlCopyPictureFormat.xlBitmap)
End Sub

備註

選擇性參數

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

適用於