Freigeben über


XMLNodes.Item Property

Gets the Microsoft.Office.Interop.Word.XMLNode at the specified index.

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

Syntax

'Declaration
ReadOnly Default Property Item ( _
    Index As Integer _
) As XMLNode
XMLNode this[
    int Index
] { get; }

Parameters

  • Index
    Type: System.Int32

    Indicates the position of the node that you want to retrieve.

Property Value

Type: Microsoft.Office.Interop.Word.XMLNode
The Microsoft.Office.Interop.Word.XMLNode at the specified index.

Remarks

The Item property returns a Microsoft.Office.Interop.Word.XMLNode object rather than a Microsoft.Office.Tools.Word.XMLNode control. For more information, see Programmatic Limitations of Host Items and Host Controls.

Examples

The following code example uses the Item property to get the first Microsoft.Office.Interop.Word.XMLNode in an XMLNodes collection. The example uses the Item property implicitly when a specific index of the collection is specified. This example assumes that the current document contains an XMLNodes control named SampleInsertNodes.

Private Sub DisplayNodeName()
    Dim node1 As Word.XMLNode = Me.SampleInsertNodes(1)
    MsgBox(node1.BaseName)

End Sub
private void DisplayNodeName()
{
    Word.XMLNode node1 = this.SampleInsertNodes[1];
    MessageBox.Show(node1.BaseName);
}

.NET Framework Security

See Also

Reference

XMLNodes Interface

Microsoft.Office.Tools.Word Namespace