Very often macros are used for processing a document. It is fairly common to have a macro step through all the paragraphs in your document and make changes based on the information in the paragraph.
If you need to step through all the paragraphs in a document, it is helpful to find out how many paragraphs there are.
The easiest method for you do that in a VBA macro is using the Count property with the Paragraphs collection, as follows:
iParCount = ActiveDocument.Paragraphs.Count
The Paragraphs collection contains all of the paragraphs in your document, each in its own object. The Count property returns a value indicating how many objects (paragraphs) are in the collection. In the example above, this value is assigned to the iParCount variable. You can then use this count in doing any processing you need to.
Please note, that paragraphs can be empty in Word. If you key in some information and then click the Enter key two times, you have just created an empty paragraph with that second Enter click. This increases the paragraph count, so it is always good to have your Show/Hide enabled so that you see non-printing characters in your document if you are trying to figure out how VBA reached the paragraph count it did. The rule is that each click of Enter will result in a new document paragraph.
Many thanks to Allen Wyatt for the macro in this newsletter!