Condividi tramite


Proprietà XmlMappedRange.Text

Ottiene il testo per il controllo XmlMappedRange.

Spazio dei nomi:  Microsoft.Office.Tools.Excel
Assembly:  Microsoft.Office.Tools.Excel (in Microsoft.Office.Tools.Excel.dll)

Sintassi

'Dichiarazione
ReadOnly Property Text As Object
    Get
Object Text { get; }

Valore proprietà

Tipo: System.Object
Testo per il controllo XmlMappedRange.

Esempi

Nell'esempio di codice riportato di seguito viene confrontato il diverso comportamento delle proprietà Text e Value2 in relazione alle celle che contengono numeri formattati. Nell'esempio si presuppone che il foglio di lavoro corrente contenga un controllo XmlMappedRange denominato 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());
}

Sicurezza di .NET Framework

Vedere anche

Riferimenti

XmlMappedRange Interfaccia

Spazio dei nomi Microsoft.Office.Tools.Excel