XMLNode.Level 屬性
取得 XMLNode 控制項的層級。
命名空間: Microsoft.Office.Tools.Word
組件: Microsoft.Office.Tools.Word (在 Microsoft.Office.Tools.Word.dll 中)
語法
'宣告
ReadOnly Property Level As WdXMLNodeLevel
WdXMLNodeLevel Level { get; }
屬性值
型別:Microsoft.Office.Interop.Word.WdXMLNodeLevel
其中一個 WdXMLNodeLevel 值。
範例
下列程式碼範例使用 Level 屬性來顯示 XMLNode 控制項的層級, 此範例假設目前的文件包含名為 CustomerNode 的 XMLNode。
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);
}
.NET Framework 安全性
- 完全信任立即呼叫者。這個成員無法供部分信任的程式碼使用。如需詳細資訊,請參閱從部分受信任程式碼使用程式庫。