XmlMappedRange.Text (Propiedad)

Obtiene el texto del control XmlMappedRange.

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

Sintaxis

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

Valor de propiedad

Tipo: System.Object
Texto del control XmlMappedRange.

Ejemplos

En el siguiente ejemplo de código se compara cómo difieren las propiedades Text y Value2 para celdas que contienen números con formato. En este ejemplo de código se supone que la hoja de cálculo actual contiene un control XmlMappedRange denominado CustomerLastNameCell.

Private Sub CompareTextAndValue2()
    Me.CustomerAddress1Cell.Value2 = 1198.3
    Me.CustomerAddress1Cell.NumberFormat = "$#,##0"

    ' Displays "1198.3".
    MsgBox("The Value2 value is: " & Me.CustomerAddress1Cell.Value2.ToString())

    ' Displays "$1,198".
    MsgBox("The Text value is: " & Me.CustomerAddress1Cell.Text.ToString())
End Sub
private void CompareTextAndValue2()
{
    this.CustomerAddress1Cell.Value2 = 1198.3;
    this.CustomerAddress1Cell.NumberFormat = "$#,##0";

    // Displays "1198.3".
    MessageBox.Show("The Value2 value is: " + 
        this.CustomerAddress1Cell.Value2.ToString());

    // Displays "$1,198".
    MessageBox.Show("The Text value is: " +
        this.CustomerAddress1Cell.Text.ToString());
}

Seguridad de .NET Framework

Vea también

Referencia

XmlMappedRange Interfaz

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