Freigeben über


NamedRange.CopyPicture(XlPictureAppearance, XlCopyPictureFormat) Methode

Definition

Kopiert das NamedRange-Steuerelement als Bild in die Zwischenablage.

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

Gibt an, wie das Bild kopiert werden soll. Dies kann eine der folgenden XlPictureAppearance Konstanten sein: xlPrinterxlScreen

Format
XlCopyPictureFormat

Das Format des Bilds. Dies kann eine der folgenden XlCopyPictureFormat Konstanten sein: xlBitmapxlPicture

Gibt zurück

Beispiele

Im folgenden Codebeispiel wird ein NamedRange erstellt und mit dem Wort Smith aufgefüllt. Anschließend wird die CopyPicture -Methode verwendet, um die als Bitmap in die NamedRange Zwischenablage zu kopieren.

Dieses Beispiel gilt für eine Anpassung auf Dokumentebene.

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

Hinweise

Optionale Parameter

Informationen zu optionalen Parametern finden Sie unter Optionale Parameter in Office-Projektmappen.

Gilt für: