View Single Post
 
Old 05-24-2021, 10:49 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,176
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

I think I can see where your style movement is coming from.

Your code inserts heaps of paragraph marks. Paragraph marks is where the Paragraph style is stored. Then when you do a clean up in your second macro which removes the excess paragraph marks, the paragraph mark that ends up at the end of the paragraph comes from the trailing paragraph (hence the style below gets applied to the paragraph above).

If you modify the first macro to avoid inserting extra paragraph marks then you won't need to merge paragraphs later on. Alternatively, you could remove the empty paragraphs instead of replacing two (or more) consecutive paragraph marks with one.

I would fix the first macro and get rid of the extra paragraphs right up front to simplify the later processing.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote