Compartilhar via


Propriedade NamedRange.Width

Obtém a largura do controle de NamedRange em pontos.

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

Sintaxe

'Declaração
ReadOnly Property Width As Object
Object Width { get; }

Valor de propriedade

Tipo: System.Object
A largura do controle de NamedRange em pontos.

Exemplos

O exemplo de código a seguir cria NamedRange e usar as propriedades de Width e de Height para exibir a largura e altura de NamedRange.

Este exemplo é para uma personalização de um documento nível.

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

Segurança do .NET Framework

Consulte também

Referência

NamedRange Interface

Namespace Microsoft.Office.Tools.Excel