Export (0) Print
Expand All

XMLNode.ChildNodeSuggestions Property

Gets an XMLChildNodeSuggestions collection that represents the elements that may be valid children of the current XMLNode control.

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

XMLChildNodeSuggestions ChildNodeSuggestions { get; }

Property Value

Type: Microsoft.Office.Interop.Word.XMLChildNodeSuggestions
An XMLChildNodeSuggestions collection that represents the elements that may be valid children of the current XMLNode control.

Each XMLChildNodeSuggestion in an XMLChildNodeSuggestions collection is an item in the list of allowed XML elements at the bottom of the XML Structure task pane.

The following code example uses the ChildNodeSuggestions property to add all of the child elements of an XMLNode. This example assumes that the current document contains an XMLNode named CustomerNode.

private void AddChildNodesFromSuggestions()
{
    foreach (Word.XMLChildNodeSuggestion suggestion1 in  
        this.CustomerNode.ChildNodeSuggestions)
    {
        suggestion1.Insert(ref missing);
    }
}

Show:
© 2015 Microsoft