RE: Word. A count of characters in what? A page? A section? The entire document.
Are giving this a function a input string? Or picking up a piece of text from the document?
The character count under Tools is OK, but it does have it sloppiness. For example, a document with:
Table 1 - 4 columns/ 4 rows, and a formfield(first cell/last row); no text in cell contents
An empty paragraph.
Table 2 - 3 columns/ 3 rows and a formfield(first cell/last row); no text in cell contents
Two empty paragraphs.
An ActiveX command button
One empty paragraph
Table 3 - 5 columns/ 5 rows and a formfield(first cell/last row); no text in cell contents
So...NO text anywhere. Formfields are empty. This was a testing document. Statistics from Tools > Word Count.
Pages = 1 - no surprise
Words = 1 - huh?
Character (no spaces) = 5
Character (with spaces) = 5
Paragraphs = 0
Lines = 1
OK empty paragraphs are not counted as paragraphs by Tools > Word Count. They ARE counted by ActiveDocument.Content.Paragraphs.Count...along with a bunch more. In fact Content.Paragraphs.Count = 68! Tables cells are in fact separated by paragraph marks.
But darned if I can figure out characters = 5, or line = 1. There is NO text, and only 1 line...??
So you do have to be careful on any counting. However, if you are counting characters in a string, that you can make a Range, then you can be more accurate.
Word counts a range as a long integer count from Start to End. Every character = 1. This includes spaces.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.