S
Scott P
Hi,
I am trying to count the number of characters in a MS Word document. My
document contains the text "Hello world." with a paragraph mark following the
text. The "Word Count" feature within MS Word indicates that my document
contains 12 characters (with spaces).
The following VBA code applied to this document, however, indicates that my
document contains 13 characters:
Sub CharacterCode()
Dim lngChar As Long
lngChar = ActiveDocument.Characters.Count
Debug.Print "lngChar = " & lngChar
End Sub
Why is there a difference between these character count values and, perhaps
more specifically, why is VBA indicating that there is an extra character in
my document as compared in MS Word's native "Word Count" feature?
Thank you in advance for your input on this topic.
I am trying to count the number of characters in a MS Word document. My
document contains the text "Hello world." with a paragraph mark following the
text. The "Word Count" feature within MS Word indicates that my document
contains 12 characters (with spaces).
The following VBA code applied to this document, however, indicates that my
document contains 13 characters:
Sub CharacterCode()
Dim lngChar As Long
lngChar = ActiveDocument.Characters.Count
Debug.Print "lngChar = " & lngChar
End Sub
Why is there a difference between these character count values and, perhaps
more specifically, why is VBA indicating that there is an extra character in
my document as compared in MS Word's native "Word Count" feature?
Thank you in advance for your input on this topic.