NamedRange.Width (Propiedad)

Obtiene el ancho del control NamedRange, expresado en puntos.

Espacio de nombres:  Microsoft.Office.Tools.Excel
Ensamblado:  Microsoft.Office.Tools.Excel (en Microsoft.Office.Tools.Excel.dll)

Sintaxis

'Declaración
ReadOnly Property Width As Object
    Get
Object Width { get; }

Valor de propiedad

Tipo: System.Object
Ancho del control NamedRange, expresado en puntos.

Ejemplos

En el ejemplo de código siguiente se crea NamedRange y, a continuación, se utilizan las propiedades Width y Height para mostrar el ancho y alto de NamedRange.

Se trata de un ejemplo para una personalización en el nivel del documento.

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

Seguridad de .NET Framework

Vea también

Referencia

NamedRange Interfaz

Microsoft.Office.Tools.Excel (Espacio de nombres)