Compartir a través de


DocumentBase.ChildNodeSuggestions Property

Definition

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).

public:
 property Microsoft::Office::Interop::Word::XMLChildNodeSuggestions ^ ChildNodeSuggestions { Microsoft::Office::Interop::Word::XMLChildNodeSuggestions ^ get(); };
public Microsoft.Office.Interop.Word.XMLChildNodeSuggestions ChildNodeSuggestions { get; }
member this.ChildNodeSuggestions : Microsoft.Office.Interop.Word.XMLChildNodeSuggestions
Public ReadOnly Property ChildNodeSuggestions As XMLChildNodeSuggestions

Property Value

An XMLChildNodeSuggestions collection.

Examples

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);
    }
}
Private Sub DocumentChildNodeSuggestions()
    Dim suggestion As Word.XMLChildNodeSuggestion
    For Each suggestion In Me.ChildNodeSuggestions
        suggestion.Insert()
    Next suggestion
End Sub

Remarks

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.

Applies to