I am trying to create a macro for an admin to use to justify the paragraphs for an entire document while leaving the heading of the document alone.
Here is what I have so far, which justifies the entire document, including the heading:
' ChangeAlign Macro
iParCount = ActiveDocument.Paragraphs.Count
For J = 1 To iParCount
sMyPar = ActiveDocument.Paragraphs(J).Range.Text
'[Add processing comments to manipulate sMyPar]
Selection.ParagraphFormat.Alignment = wdAlignParagraphJustify
ActiveDocument.Paragraphs(J).Range.Text = sMyPar
I will attach an example Test Document.
The macro works, however it also justifies the heading "SECTION 21 00 10
GENERAL REQUIREMENTS FOR FIRE PROTECTION WORK" as well as the "END OF SECTION" portion of the document. I would like the macro to NOT affect those two sections at the beginning and end of the document. It would have been simpler if those two items were actually part of the header and footer, but they are not, they are part of the main body of text. I know there is a way to do this, as I had found a macro on the net before that did precisely what I'm asking, however I've lost it and the admin's PC was re-imaged so she lost the macro as well. I can no longer locate the site I found the macro on initially so I'm starting from scratch.