Share via


NamedRange.CopyPicture-Methode

Kopiert das NamedRange-Steuerelement als Bild in die Zwischenablage.

Namespace:  Microsoft.Office.Tools.Excel
Assembly:  Microsoft.Office.Tools.Excel (in Microsoft.Office.Tools.Excel.dll)

Syntax

'Declaration
Function CopyPicture ( _
    Appearance As XlPictureAppearance, _
    Format As XlCopyPictureFormat _
) As Object
Object CopyPicture(
    XlPictureAppearance Appearance,
    XlCopyPictureFormat Format
)

Parameter

Rückgabewert

Typ: System.Object

Hinweise

Optionale Parameter

Informationen zu optionalen Parametern finden Sie unter Optionale Parameter in Office-Lösungen.

Beispiele

Im folgenden Codebeispiel wird ein NamedRange erstellt und mit dem Wort "Smith" aufgefüllt. Anschließend wird der NamedRange mithilfe der CopyPicture-Methode als Bitmap in die Zwischenablage kopiert.

Dieses Beispiel bezieht sich auf eine Anpassung auf Dokumentebene.

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
Microsoft.Office.Tools.Excel.NamedRange copyBitmapRange;
private void CopyAsBitmap()
{
    copyBitmapRange = this.Controls.AddNamedRange(
        this.Range["C3", missing], "copyBitmapRange");
    this.copyBitmapRange.Value2 = "Smith";
    this.copyBitmapRange.CopyPicture(
        Excel.XlPictureAppearance.xlScreen,
        Excel.XlCopyPictureFormat.xlBitmap);
}

.NET Framework-Sicherheit

Siehe auch

Referenz

NamedRange Schnittstelle

Microsoft.Office.Tools.Excel-Namespace