NamedRange.CopyPicture(XlPictureAppearance, XlCopyPictureFormat) Méthode

Définition

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

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

Paramètres

Appearance
XlPictureAppearance

Spécifie la façon dont l’image doit être copiée. Il peut s’agir de l’une des constantes suivantes XlPictureAppearance : xlPrinterxlScreen

Format
XlCopyPictureFormat

Format de l’image. Il peut s’agir de l’une des constantes suivantes XlCopyPictureFormat : xlBitmapxlPicture

Retours

Exemples

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

Cet exemple concerne une personnalisation au niveau du document.

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

Remarques

Paramètres facultatifs

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

S’applique à