Compartilhar via


Propriedade XMLNode.Level

Obtém o nível da XMLNode de controle.

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

Sintaxe

'Declaração
ReadOnly Property Level As WdXMLNodeLevel
    Get
WdXMLNodeLevel Level { get; }

Valor de propriedade

Tipo: Microsoft.Office.Interop.Word.WdXMLNodeLevel
Dentre as WdXMLNodeLevel valores.

Exemplos

O seguinte exemplo de código usa a Level propriedade para exibir o nível de um XMLNode de controle. Este exemplo assume que o documento atual contém um XMLNode chamado CustomerNode.

Private Sub DisplayCustomerNodeLevel()
    Dim level As String = String.Empty

    Select Case Me.CustomerNode.Level
        Case Word.WdXMLNodeLevel.wdXMLNodeLevelCell
            level = "cell level."
        Case Word.WdXMLNodeLevel.wdXMLNodeLevelInline
            level = "inline level."
        Case Word.WdXMLNodeLevel.wdXMLNodeLevelParagraph
            level = "paragraph level."
        Case Word.WdXMLNodeLevel.wdXMLNodeLevelRow
            level = "row level."
        Case Else
            level = "undeterminable level."
    End Select
    MsgBox("The Customer node is at " & level)
End Sub
private void DisplayCustomerNodeLevel()
{
    string level = string.Empty;

    switch (this.CustomerNode.Level)
    {
        case Word.WdXMLNodeLevel.wdXMLNodeLevelCell:
            level = "cell level.";
            break;
        case Word.WdXMLNodeLevel.wdXMLNodeLevelInline:
            level = "inline level.";
            break;
        case Word.WdXMLNodeLevel.wdXMLNodeLevelParagraph:
            level = "paragraph level.";
            break;
        case Word.WdXMLNodeLevel.wdXMLNodeLevelRow:
            level = "row level.";
            break;
        default:
            level = "undeterminable level.";
            break;
    }

    MessageBox.Show("The Customer node is at " + level);
}

Segurança do .NET Framework

Consulte também

Referência

XMLNode Interface

Namespace Microsoft.Office.Tools.Word