Characters and Line Count 
Author Message
 Characters and Line Count

(Word 2000) I need a macro that gives me the line and
character count, as they appear in the Tools->Word Count
menu.
For character count, I use:
ActiveDocument.Characters.Count
However, the number it gives me differs from the number
that appears in Tools->WordCount->Characters(including
spaces).This has something to do with the fact that Word
counts paragraphs differently when you do it
programmatically and from the menu. (try it on a document
that has some blank paragraphs with Spacing Before/After
set to 0 and pagination controls unchecked). I however
need to get programmatically the same figure as in Tools-
Quote:
>WordCount->Characters(including spaces).

The second part of the problem is that there is no code
that looks like ActiveDocument.Lines.Count
How to get the line count programmatically?


Mon, 12 Sep 2005 23:42:53 GMT  
 Characters and Line Count
Try:

Dim Test
Test = ActiveDocument.ComputeStatistics(wdStatisticLines)

Check out the on-line help for ComputeStatistics

HTH
--
_________________________________________

Jean-Guy Marcil



Quote:
> (Word 2000) I need a macro that gives me the line and
> character count, as they appear in the Tools->Word Count
> menu.
> For character count, I use:
> ActiveDocument.Characters.Count
> However, the number it gives me differs from the number
> that appears in Tools->WordCount->Characters(including
> spaces).This has something to do with the fact that Word
> counts paragraphs differently when you do it
> programmatically and from the menu. (try it on a document
> that has some blank paragraphs with Spacing Before/After
> set to 0 and pagination controls unchecked). I however
> need to get programmatically the same figure as in Tools-
> >WordCount->Characters(including spaces).
> The second part of the problem is that there is no code
> that looks like ActiveDocument.Lines.Count
> How to get the line count programmatically?



Tue, 13 Sep 2005 00:12:25 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. line input lines greater than 255 characters?

2. running character count

3. Counting characters as they are typed

4. counting characters in a string

5. COUNT OF CHARACTERS IN A MAIL

6. How to count the Reference Characters ?

7. Count occurances of a character string?

8. Ignore strikethrough text in document character count

9. Scanning text & objDoc.Characters.Count

10. variable character count

11. Characters.Count vs. ComputeStatistics

12. Characters count without space in VB.NET

 

 
Powered by phpBB® Forum Software