XMLChildNodeSuggestions Collection

Microsoft Word Visual Basic

XMLChildNodeSuggestions Collection

Multiple objects XMLChildNodeSuggestions
XMLChildNodeSuggestion
XMLSchemaReference

Represents a collection of XMLChildNodeSuggestion objects that represent elements that may be valid children of the specified element according to the schema. This collection is read-only.

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

Using the XMLChildNodeSuggestions Collection

Use the Item method to return an individual XMLChildNodeSuggestion object. Use the ChildNodeSuggestions property of the Document object to access the XMLChildNodeSuggestions collection that represents the root elements of any attached schemas. Use the ChildNodeSuggestion property of the XMLNode object to access the XMLChildNodeSuggestions collection for a specific element in a document. Use the Insert method to insert at the insertion point position the XML element associated with an XMLChildNodeSuggestion object.

The following example loops through the suggestions for the first element selected in the active document and inserts all allowed elements at the insertion point postion.

    Dim objSuggestion As XMLChildNodeSuggestion
Dim objNode As XMLNode
    
Set objNode = Selection.XMLNodes.Item(1)
    
For Each objSuggestion In objNode.ChildNodeSuggestions
    objSuggestion.Insert
    Selection.MoveRight
Next