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);

Parameter

Appearance
XlPictureAppearance

Gibt an, wie das Bild kopiert werden soll.

Kann eine der folgenden XlPictureAppearance-Konstanten sein: xlPrinterxlScreen

Format
XlCopyPictureFormat

Das Format des Bilds.

Kann eine der folgenden XlCopyPictureFormat-Konstanten sein: xlBitmapxlPicture

Gibt zurück

Object

Beispiele

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

Dieses Beispiel gilt für eine Anpassung auf Dokument Ebene.

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

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

Gilt für