I've got a word document with more or less the following structure:
Title
Heading 1
Heading 2
Text
Heading 2
Text
Heading 1
Heading 2
Text
...
I'd like page breaks before all H2 headings, except the ones directly after H1 headings, when I'd prefer the two headings to be on the same page.
I know I can automatically set "page break before" in the style for Heading 2, but is there some way I can set an "except directly after Heading 1" option without having to add all the page breaks manually?
In other words, I'd like the breaks as follows:
Title
-- Page Break --
Heading 1
Heading 2
Text
-- Page Break --
Heading 2
Text
-- Page Break --
Heading 1
Heading 2
Text
-- Page Break --
Heading 2
Text
...
Best Answer
Creating a new style will accomplish what you want. Try this procedure:
Word
insert a page break before all Heading 2 text.VBA development environment
, then click "Insert > Module" to open a new window for entering programs.Code to paste:
Press Alt+F11 to return to
Word
, then press Alt+F8 to open the Macros dialog box. Double click the "replace_Heading2_with_Heading2Prime" item to run the macro.I hope this helps.