How to refresh text rendering after executing a macro ?

asked 2021-04-30 20:29:34 +0200

JGL gravatar image

Hello everyone,

Background - I have a document with multiple short sections (e.g. 1/4 page lenght) comprizing a heading and a varying number very short paragraphs. I want to avoid having the paragraphs of a section spanning over two pages (i.e. starting a the bottom of a page and ending at the top of the next). I used styles (Heading 4 and Text body). Can't have "Heading 4" to be set to have a page break before since every short section would have its own page, which is not desirable (document page count would skyrocket).

I ended up having "Text body" to be set to "Keep with next paragraph" and building a macro which sweeps through all paragraphs, unticking the "Keep with next paragraph" option for every paragraph preceding a heading.

Question - The macro is doing its job as expected (unticking the "Keep with next paragraph" options for the required paragraphs, but the text rendering is not refreshed automatically after the macro is done. The view seems in need to be refreshed so the sections move on the right page as expected now that only the paragraphs that should stay together actually do. Is there a Refresh() or Render() or any such function that would do the trick ?

edit retag flag offensive close merge delete