OLD:
Code: Select all
For Each strP In rng.Paragraphs
Call strStatusBar("Loading " & Format(100 * (strP.Range.Start / ActiveDocument.Characters.Count), "##0.000") & "%")
Code: Select all
Dim lngCharCount As Long
lngCharCount = ActiveDocument.Characters.Count
For Each strP In rng.Paragraphs
Call strStatusBar("Loading " & Format(100 * (strP.Range.Start / lngCharCount), "##0") & "%")
The new code flashes by so quickly I almost don't get time to read the formatted string in the Statusbar!
I stared at the 3-decimal places in the Statusbar string, decided to get rid of them by changing the format string, and found the call to ActiveDocument.Characters.Count right there inside the loop.
That has prompted me to search my code database looking for all other occurences of ActiveDocument.Characters. and similar constructs.