TRaP
Moderator
Inregistrat: acum 7 ani
Postari: 807
|
|
See post #3 for Non-VBA solution
In Word if you create headings (eg. select paragraph / subtitle and click on the style Heading 2 for example) and collapse (close) them all, then save your document and close it, when you open the document again all the headings will be expanded (open) again. You normally cannot open a document with all headings collapsed (closed).
In order to make it happen, you have 2 options:
1. Saving document as macro-enabled (docm) file
Open VBA and under ThisDocument paste the following code:
Private Sub Document_Open() ActiveDocument.ActiveWindow.View.CollapseAllHeadings End Sub |
2. Keeping document as normal (doc/docx) file
Note: the headings won't be collapsed on open, but you can collapse and expand them all whenever you want
Paste the following code into a module, then create 2 buttons in your QAT or ribbon for each of the following 2 macros:
Sub Headings_Expand() ActiveDocument.ActiveWindow.View.ExpandAllHeadings End Sub
Sub Headings_Collapse() ActiveDocument.ActiveWindow.View.CollapseAllHeadings End Sub |
|
|