Share via

How do I implement automatic conditional paragraph or header spacing?

Anonymous
2015-02-04T10:28:01+00:00

I have a set of documents with hierarchical numbered headings. I want there to be 18 points of white space between the last paragraph of text and an H1 or H2 heading which follows it, or 12 points of white space between the last paragraph of text and an H3 heading which follows it. If the paragraph is followed by another text paragraph or a bulleted list entry I want the spacing to be only 6 points. Is there a way to have this happen automatically?

I tried setting an 18 point "before" spacing in the H1 and H2 styles but then I get the 18 points of white space between an H1 and an H2 heading when one follows straight after the other. I don't want that at all.

The best I've managed is to define two three paragraph styles - one with 6 points of "after" space (for most text paragraphs), another with 12 points of "after" space for text paragraphs which are followed by an H3 heading, and a third with 18 points of "after" space for text paragraphs which are followed by an H1 or H2 heading. However this relies on the user remembering to select the correct text paragraph style as well as remembering to change it if he or she changes the heading level of the following heading. That's putting too much reliance on the person editing the document, and mis-formatting is bound to creep in.

Is there a way to automate this within the styles?

Note that I have considered writing a macro to run after all other editing is complete, which would go through each paragraph in turn and tweak the spacing, but that seems clumsy and would also mean the user has to go through the document again to check that the tweaks the macro has done don't mess up the pagination (there are occasions when I can envisage wanting to override the spacing to keep a single short paragraph of text from running over onto a new page).

Hoping someone can suggest a better way forward,

Bruce Officer

Microsoft 365 and Office | Word | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2015-02-04T12:09:19+00:00

Bruce

There is no automatic way of doing what you are asking. Word styles have only one possible 'special case' spacing override which is to remove spacing between paragraphs with the same style.

I think you would need a macro to do what you require and there is no simple way to avoid the need for a subsequent pagination check. Putting blank paragraphs of various heights has a significant problem of impacting the 'keep with next' options and will be a pain around page breaks.

Was this answer helpful?

0 comments No comments

0 additional answers

Sort by: Most helpful