PDA

View Full Version : “Style for following paragraph” use preceding built in heading after style separator



bts2000
01-12-2020, 08:58 PM
Does anyone know a means within word (using VBA or otherwise) so that the setting “Style for following paragraph” would take on the preceding built in heading style after using a “Style Separator” (immediately after the heading) and then there is intervening paragraph text before the closing paragraph symbol.

So for example:

Say a document was formatted as follows:

"A Heading here (formatted with built in style 'Heading 1')" [Style Separator Here: (Ctrl+Alt+Enter] "Some paragraph text here. More paragraph text. (formatted with built in style 'Normal')"

User then hits enter, the desired effect would be that the next paragraph would start with the "Heading 1" style (despite the fact that there is an intervening style separator and succeeding paragraph text formatted with the normal style. Similarly, if there was a paragraph formatted exactly as stated above except the lead in heading was formatted with "Heading 2" (followed again by a style separator and some body text formatted as normal), then after the user hits "enter" to start a new paragraph, word would start the new paragraph with the "Heading 2" style (as opposed to the style that was used in the paragraph after the style separator). Ditto for Heading 3...9, et al.

Thanks for any help anyone can offer with this.

-Brian

gmayor
01-13-2020, 02:53 AM
http://www.gmayor.com/table_of_contents_addin.html has an option to insert a style separator which uses a slightly different method than the built-in method, in that it uses two separate styles. If you format the second style to be followed with the heading style, that's what will happen, however it will only do so if you press the enter key at the end of the paragraph after creating the split heading para.