Page 1 of 1
Selecting first paragraphs of chapters
Posted: 2018-09-22 07:28:16
by Kadah
Hi!
I have a book that has an enormous number of chapters and subchapters. I would like to be able to select all the first paragraphs of those chapters and subchapters to change their indention. But is there a way to do it e.g. using a macro, not manually?
Re: Selecting first paragraphs of chapters
Posted: 2018-09-22 07:53:39
by phspaelti
Hi Kadah,
the short answer to your question is 'yes'. But to do this one will need more information. How can one recognize Chapters, sub-chapters in your document? Are you using styles ("Heading 1", etc.)? A macro thread that discusses this kind of problem can be found
here. If you need help with how to implement that for your case, let me know.
Re: Selecting first paragraphs of chapters
Posted: 2018-09-23 06:12:04
by Kadah
Hi! First of all, thank you for your help. I tried looking at the link you provided, but the discussion there seemed to be a bit too technical. I learned how to use macros, but I am not sure yet how to write one, so if you’d be willing to help me further, I’d appreciate that.
All the chapters and sub-chapters have the Heading style applied to them (from Heading 1 to Heading 4). I would like to be able to select all the paragraphs following the paragraphs with Heading 2, 3 and 4 style applied and change their indentation from 0.8 cm to 0 cm. The heading 2, 3 and 4 styles are aligned to left so the first paragraphs following them would look better with no indentation.
Thanks in advance!
Re: Selecting first paragraphs of chapters
Posted: 2018-09-23 07:43:08
by phspaelti
Hello again. I am attaching a macro that will select the first paragraph after the requested heading paragraphs. This macro will not change the indentation, you can just do that once the paragraphs have been selected. (Alternately you can apply a style to the selected paragraphs and change their indentation that way.) It would be easy enough to add code for this, but that would just limit the usefulness of the macro.
I put some comments in the macro which should help a bit to understand how it works. I can also provide more elaborate explanations, if desired.
Hope that helps.
Re: Selecting first paragraphs of chapters
Posted: 2018-09-30 05:42:06
by Kadah
IT WORKS!!! Thank you so much, doing this by hand was driving me crazy. Thank you! You're great!
Re: Selecting first paragraphs of chapters
Posted: 2019-12-12 21:25:25
by phspaelti
The original macro was hardwired to work only for Heading 2,3, & 4 . This is an updated version that lets you choose the heading styles at runtime.