NamedRange.CopyPicture, méthode

Copie le contrôle NamedRange vers le Presse-papiers en tant qu'image.

Espace de noms :  Microsoft.Office.Tools.Excel
Assembly :  Microsoft.Office.Tools.Excel (dans Microsoft.Office.Tools.Excel.dll)

Syntaxe

'Déclaration
Function CopyPicture ( _
    Appearance As XlPictureAppearance, _
    Format As XlCopyPictureFormat _
) As Object
Object CopyPicture(
    XlPictureAppearance Appearance,
    XlCopyPictureFormat Format
)

Paramètres

Valeur de retour

Type : System.Object

Notes

Paramètres optionnels

Pour plus d'informations sur les paramètres optionnels, consultez Paramètres optionnels dans les solutions Office.

Exemples

L'exemple de code suivant crée un NamedRange et le remplit avec le mot "Smith". Il utilise ensuite la méthode CopyPicture pour copier un NamedRange vers le Presse-papiers en tant que bitmap.

Cet exemple illustre une personnalisation au niveau du document.

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

Sécurité .NET Framework

Voir aussi

Référence

NamedRange Interface

Microsoft.Office.Tools.Excel, espace de noms