![]() |
|
#3
|
||||
|
||||
|
Quote:
Code:
Sub ParagraphCount() MsgBox ActiveDocument.Paragraphs.Count End Sub Code:
Sub ParagraphCount() MsgBox ActiveDocument.ComputeStatistics(wdStatisticParagraphs) End Sub • all the flickering; • messing with the selected range; • the overhead of a loop; and • having to insert a quite arbitrary exit point to overcome your code's propensity for locking up Word? Furthermore, your code doesn't handle tables correctly. Moreover, since you haven't defined what 'counter' is, that: • can result in complier errors (i.e. if one uses 'Option Explicit', which is always good practice); and • results in an variant, which is less efficient to use than if it was properly defined it as a long. PS: When posting code, please use the code tags, indicated by the # button on the posting menu. Without them, your code loses much of whatever structure it had.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
How to loop once through document
|
PrincessApril | Word VBA | 4 | 04-12-2020 06:06 AM |
Loop thru document and create bookmarks
|
jeffreybrown | Word VBA | 3 | 09-22-2018 06:04 AM |
| Loop true all opned word document | elbartje | Word VBA | 1 | 06-12-2017 05:27 PM |
| VB for Word - Need macro to loop each line in a document | NDeane | Word VBA | 5 | 12-22-2015 08:12 PM |
Loop through files and Copy Table Row and Paste into Different Document
|
spiderman1369 | Word VBA | 2 | 10-15-2014 08:30 AM |