Expand Minimize

DocumentBase.ChildNodeSuggestions Property

Gets an XMLChildNodeSuggestions collection that represents the list of allowed elements for the DocumentBase (which returns the root elements for all attached schemas) or for the XMLNode object (which returns the child elements of a specified element).

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

public XMLChildNodeSuggestions ChildNodeSuggestions { get; }

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

The following code example uses the ChildNodeSuggestions property to add an XML element to the document for each of the root elements of the schemas attached to the document. To use this example, run it from the ThisDocument class in a document-level project.

private void DocumentChildNodeSuggestions()
{
    foreach (Word.XMLChildNodeSuggestion suggestion in 
        this.ChildNodeSuggestions)
    {
        suggestion.Insert(ref missing);
    }
}

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft