共用方式為


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)

Syntax

'Declaration
ReadOnly Property ChildNodeSuggestions As XMLChildNodeSuggestions
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.

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.

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 Sub AddChildNodesFromSuggestions()
    Dim suggestion1 As Word.XMLChildNodeSuggestion
    For Each suggestion1 In Me.CustomerNode.ChildNodeSuggestions
        suggestion1.Insert()
    Next suggestion1
End Sub
private void AddChildNodesFromSuggestions()
{
    foreach (Word.XMLChildNodeSuggestion suggestion1 in  
        this.CustomerNode.ChildNodeSuggestions)
    {
        suggestion1.Insert(ref missing);
    }
}

.NET Framework Security

See Also

Reference

XMLNode Interface

Microsoft.Office.Tools.Word Namespace