NamedRange.Width, propriété

Obtient la largeur du contrôle NamedRange en points.

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

Syntaxe

'Déclaration
ReadOnly Property Width As Object
    Get
Object Width { get; }

Valeur de propriété

Type : System.Object
Largeur du contrôle NamedRange en points.

Exemples

L'exemple de code suivant crée un NamedRange, puis utilise les propriétés Width et Height pour afficher la largeur et la hauteur de NamedRange.

Cet exemple illustre une personnalisation au niveau du document.

Private heightWidthRange As Microsoft.Office.Tools.Excel.NamedRange

Private Sub DisplayHeightAndWidth()
    heightWidthRange = Me.Controls.AddNamedRange( _
        Me.Range("B4"), "heightWidthRange")
    heightWidthRange.Select()
    MessageBox.Show("The NamedRange control is " & _
        Me.heightWidthRange.Width & " points wide and " & _
        Me.heightWidthRange.Height & " points high.")
End Sub
Microsoft.Office.Tools.Excel.NamedRange heightWidthRange;
private void DisplayHeightAndWidth()
{
    heightWidthRange = this.Controls.AddNamedRange(
        this.Range["B4", missing], "heightWidthRange");
    heightWidthRange.Select();
    MessageBox.Show("The NamedRange control is " +
    this.heightWidthRange.Width + " points wide and " +
    this.heightWidthRange.Height + " points high.");
}

Sécurité .NET Framework

Voir aussi

Référence

NamedRange Interface

Microsoft.Office.Tools.Excel, espace de noms