Subdocuments.Expanded property (Word)

True if the subdocuments in the specified document are expanded. Read/write Boolean.

Syntax

expression. Expanded

expression A variable that represents a 'Subdocument' object.

Example

This example expands all subdocuments in the active master document.

If ActiveDocument.Subdocuments.Count >= 1 Then 
 ActiveDocument.Subdocuments.Expanded = True 
End If

This example switches the Expanded property between expanding all subdocuments in the active window and collapsing all subdocuments in the active document.

ActiveDocument.Subdocuments.Expanded = _ 
 Not ActiveDocument.Subdocuments.Expanded

This example determines whether the subdocuments in Report.doc are expanded and then displays a message indicating their status.

If Documents("Report.doc").Subdocuments.Expanded = True Then 
 MsgBox "All available information is displayed." 
Else 
 MsgBox "Expand subdocuments for more information." 
End If

See also

Subdocuments Collection Object

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.