Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Counting the Number of Characters in a Word Document

Status
Not open for further replies.

jmrdaddy

Technical User
Jun 10, 2002
31
US
I am attempting to have VBA return the number of characters in a document using the following line of code...

lngNumChars = ActiveDocument.Content.ReadabilityStatistics(2).Value

For long documents, that value returns 32001. This method apparently returns an integer value.

Is there a way to get that value as a long? Or is there a better way to return the number of characters in a word document?
 
consider this:

Dim charCount As Long

charCount = myRange.ComputeStatistics(Statistic:=wdStatisticCharacters) Thank you,
Dave Rattigan
 
That's great! It worked! I used ActiveDocument rather than a range. Thank you!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top