共用方式為


XMLNode.ChildNodeSuggestions Property

Definition

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

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 that represents the elements that may be valid children of the current XMLNode control.

Examples

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

Remarks

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.

Applies to