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.
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for