Bagikan melalui


NamedRange.CopyPicture(XlPictureAppearance, XlCopyPictureFormat) Metode

Definisi

NamedRange Menyalin kontrol ke Clipboard sebagai gambar.

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

Parameter

Appearance
XlPictureAppearance

Menentukan bagaimana gambar harus disalin. Bisa menjadi salah satu konstanta berikut XlPictureAppearance : xlPrinterxlScreen

Format
XlCopyPictureFormat

Format gambar. Bisa menjadi salah satu konstanta berikut XlCopyPictureFormat : xlBitmapxlPicture

Mengembalikan

Contoh

Contoh kode berikut membuat NamedRange dan mengisinya dengan kata Smith. Kemudian menggunakan CopyPicture metode untuk menyalin NamedRange ke Clipboard sebagai bitmap.

Contoh ini untuk kustomisasi tingkat dokumen.

Microsoft.Office.Tools.Excel.NamedRange copyBitmapRange;
private void CopyAsBitmap()
{
    copyBitmapRange = this.Controls.AddNamedRange(
        this.Range["C3"], "copyBitmapRange");
    this.copyBitmapRange.Value2 = "Smith";
    this.copyBitmapRange.CopyPicture(
        Excel.XlPictureAppearance.xlScreen,
        Excel.XlCopyPictureFormat.xlBitmap);
}
Private copyBitmapRange As Microsoft.Office.Tools.Excel.NamedRange

Private Sub CopyAsBitmap()
    copyBitmapRange = Me.Controls.AddNamedRange( _
        Me.Range("C3"), "copyBitmapRange")
    Me.copyBitmapRange.Value2 = "Smith"
    Me.copyBitmapRange.CopyPicture( _
        Excel.XlPictureAppearance.xlScreen, _
        Excel.XlCopyPictureFormat.xlBitmap)
End Sub

Keterangan

Parameter Opsional

Untuk informasi tentang parameter opsional, lihat Parameter Opsional di Solusi Office.

Berlaku untuk