NamedRange.Height, propriété

Obtient la hauteur du contrôle NamedRange.

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

Syntaxe

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

Valeur de propriété

Type : System.Object
Hauteur du contrôle NamedRange.

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"], "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