While working on my recent article
I also developed a Word automation function to utilize Microsoft Word’s built-in word count.
I figured it might have been the easiest solution to getting a quick and reliable word count from any string.
Boy was I wrong.
What I’ve discovered is that Word erroneously counts punctuation if there are spaces in front of them. To my knowledge, an exclamation point or question mark, amongst others, are not words!
Here, a picture is worth a thousand words as they say.
In the above image, all is well, the word count of 4 is accurate.
However, in this image, I simply added a period and now the word count is 5?!
So, according to Microsoft, a period is a word! 😵 🥴
Moreover, this issue happens with any punctuation: !:,?/# …
I also tested via VBA code and it resulted in the same erroneous result.
Needless to say, one cannot rely on Microsoft Word’s statistics! I’m just floored that this is the case and actually made it out into production, something this basic and simple to validate should never have been missed in the first place. Worse is this seems to be the case for multiple versions now!
I wish I had known about this bug when I was in university and had to give professors’ minimum number of word reports! 😊

