When is a word not a word? Different counts by vba and status bar

User avatar
Charles Kenyon
4StarLounger
Posts: 596
Joined: 10 Jan 2016, 15:56
Location: Madison, Wisconsin

When is a word not a word? Different counts by vba and status bar

Post by Charles Kenyon »

:scratch: When I use vba to count the number of words in a document, I get a result different from what I see in the status bar or would count manually.
00 deleteme 10.png
What is being counted as a word in vba that is not what I might consider to be a word?
You do not have the required permissions to view the files attached to this post.
Last edited by Charles Kenyon on 12 Sep 2020, 00:47, edited 1 time in total.

User avatar
HansV
Administrator
Posts: 78232
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: When is a word not a word? Different counts by vba and status bar

Post by HansV »

ActiveDocument.Words.Count includes a lot of stuff that we normally don't consider to be words. Why? Microsoft's ways are inscrutable.

ActiveDocument.ComputeStatistics(wdStatisticWords) returns the value you would expect.
Best wishes,
Hans

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15498
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: When is a word not a word? Different counts by vba and status bar

Post by ChrisGreaves »

Charles Kenyon wrote:
05 Sep 2020, 20:15
When I use vba to count the number of words in a document, I get a result different from what I see in the status bar or would count manually.
I know that over the years I have found three, possibly four different count results reurned for the one chunk of text.
There is File, Properties, Statistics,
then there is a field {INFO NumWords}
then there is a VBA proprty e.g. "activedocument.Words.Count"
What is being counted as a word in vba that is not what I might consider to be a word?
I don't know the answer to this. One way to find out would be to pare down an example of text with differing counts until the counts agree, and then recall the most recently-pared item of punctuation.

Me? I am still smarting over the forum's search engine treating the hyphen as a space in "uh-oh" (grin)

Cheers
chris
An expensive day out: Wallet and Grimace

User avatar
Jay Freedman
Microsoft MVP
Posts: 1312
Joined: 24 May 2013, 15:33
Location: Warminster, PA

Re: When is a word not a word? Different counts by vba and status bar

Post by Jay Freedman »

The ActiveDocument.Words collection includes punctuation marks (periods, commas, question and exclamation marks, quotes, and others, but not apostrophes) and paragraph marks as separate "words". For some reason a manual line break (Shift+Enter) is counted as two words. The other methods of getting word counts ignore these things.

User avatar
Charles Kenyon
4StarLounger
Posts: 596
Joined: 10 Jan 2016, 15:56
Location: Madison, Wisconsin

Re: When is a word not a word? Different counts by vba and status bar

Post by Charles Kenyon »

Thank you Hans and Chris.

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15498
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: When is a word not a word? Different counts by vba and status bar

Post by ChrisGreaves »

Charles Kenyon wrote:
06 Sep 2020, 03:38
Thank you Hans and Chris.
And Jay "a manual line break (Shift+Enter) is counted as two words" Freedman.

Don't forget to assign some blame to Jay for adding spice to the witches brew (Huge grin!)

Cheers
Chris
An expensive day out: Wallet and Grimace

User avatar
Jay Freedman
Microsoft MVP
Posts: 1312
Joined: 24 May 2013, 15:33
Location: Warminster, PA

Re: When is a word not a word? Different counts by vba and status bar

Post by Jay Freedman »

ChrisGreaves wrote:
06 Sep 2020, 09:39
Don't forget to assign some blame to Jay for adding spice to the witches brew (Huge grin!)
Well, Halloween is less than 60 days away. The local market has already stocked up on candy and spiced wafers, so I'm just getting into the spirit (or is that spirits?).

User avatar
Charles Kenyon
4StarLounger
Posts: 596
Joined: 10 Jan 2016, 15:56
Location: Madison, Wisconsin

Re: When is a word not a word? Different counts by vba and status bar

Post by Charles Kenyon »

Thank you, Jay, as well.
I quoted you in response to a related question in another file. Apparently the Windows explorer count of words is related to the vba definition.

This should be scary enough for anyone.
perplex.jpg
You do not have the required permissions to view the files attached to this post.

User avatar
Jay Freedman
Microsoft MVP
Posts: 1312
Joined: 24 May 2013, 15:33
Location: Warminster, PA

Re: When is a word not a word? Different counts by vba and status bar

Post by Jay Freedman »

Interestingly, Bob wrote that 20 years ago. Plus ça change, plus ça même chose.

User avatar
Charles Kenyon
4StarLounger
Posts: 596
Joined: 10 Jan 2016, 15:56
Location: Madison, Wisconsin

Re: When is a word not a word? Different counts by vba and status bar

Post by Charles Kenyon »

I now have a different meme...

:cheers:
perplex2.png
You do not have the required permissions to view the files attached to this post.

User avatar
ChrisGreaves
PlutoniumLounger
Posts: 15498
Joined: 24 Jan 2010, 23:23
Location: brings.slot.perky

Re: When is a word not a word? Different counts by vba and status bar

Post by ChrisGreaves »

Charles Kenyon wrote:
05 Sep 2020, 20:15
What is being counted as a word in vba that is not what I might consider to be a word?
Hello Charles.
You have by now read this directive, Right? :evilgrin:
Washington State Appellate Filings Word Counts

Boy! It sure looks like a complicated procedure.
(a) I wonder why they don't suggest "filter via Notepad.exe" to drop images etc
(b) Since the courts seem to want to reduce verbiage, why not INCLUDE "the title sheet, the table of contents, the table of authorities, the certificate of compliance, the certificate of service, signature blocks" in the count? A limit is a limit is a limit, right?
Cheers
Chris
P.S. depending on the method used, that article comes out to around 930 words.
C
An expensive day out: Wallet and Grimace

User avatar
BobH
UraniumLounger
Posts: 9211
Joined: 13 Feb 2010, 01:27
Location: Deep in the Heart of Texas

Re: When is a word not a word? Different counts by vba and status bar

Post by BobH »

. . . Additionally, a document produced using a typewriter can continue to use 12 point font. . . .
So I guess my brief typed on my IBM Executive typewriter will be accepted so long as I observe the limit on number of pages. I wonder if they will accept carbon copies? Yes, I still have carbon paper and Liquid Paper for corrections.

Signed,
Mr. Luddite, Esq.
Bob's yer Uncle
(1/2)(1+√5)
Intel Core i5, 3570K, 3.40 GHz, 16 GB RAM, ECS Z77 H2-A3 Mobo, Windows 10 >HPE 64-bit, MS Office 2016

User avatar
Charles Kenyon
4StarLounger
Posts: 596
Joined: 10 Jan 2016, 15:56
Location: Madison, Wisconsin

Re: When is a word not a word? Different counts by vba and status bar

Post by Charles Kenyon »

But do you have onion skin for the copies?

Wisconsin appellate courts have had Word count limits for more than 20 years. That is where I practice.

User avatar
kdock
5StarLounger
Posts: 720
Joined: 21 Aug 2011, 21:01
Location: The beautiful hills of Western North Carolina

Re: When is a word not a word? Different counts by vba and status bar

Post by kdock »

ChrisGreaves wrote:
29 Aug 2021, 19:18
Since the courts seem to want to reduce verbiage, why not INCLUDE "the title sheet, the table of contents, the table of authorities, the certificate of compliance, the certificate of service, signature blocks" in the count? A limit is a limit is a limit, right?
Well, what Judges really care about is the meat of the case, that the authors get to the point, and that the courts will choke on less paper. Back in the olden days of page limitations, when the font was courier and the word processor was an IBM Selectric, page limitations were usually enough.

In later years, armed with computers and proportional fonts, clever word processors, secretaries, paralegals, and attorneys found ways to get around page limitations: use a slightly smaller font, use character spacing to move letters just barely closer together, put arguments within footnotes because footnotes are (usually) single spaced, and use a smaller font for the footnotes, to boot. The other pages are not necessary to arguing the case, but are helpful tools for reviewing the meat of the document. Some are required for valid legal reasons, such as the certificate of service. Limiting the number of words rather than pages made these resourceful tricks unnecessary.

Kim
"Hmm. What does this button do?" Said everyone before being ejected from a car, blown up, or deleting all the data from the mainframe.

User avatar
Charles Kenyon
4StarLounger
Posts: 596
Joined: 10 Jan 2016, 15:56
Location: Madison, Wisconsin

Re: When is a word not a word? Different counts by vba and status bar

Post by Charles Kenyon »

ChrisGreaves wrote:
29 Aug 2021, 19:18
Charles Kenyon wrote:
05 Sep 2020, 20:15
What is being counted as a word in vba that is not what I might consider to be a word?
Hello Charles.
You have by now read this directive, Right? :evilgrin:
Washington State Appellate Filings Word Counts

Boy! It sure looks like a complicated procedure.
(a) I wonder why they don't suggest "filter via Notepad.exe" to drop images etc
(b) Since the courts seem to want to reduce verbiage, why not INCLUDE "the title sheet, the table of contents, the table of authorities, the certificate of compliance, the certificate of service, signature blocks" in the count? A limit is a limit is a limit, right?
Cheers
Chris
P.S. depending on the method used, that article comes out to around 930 words.
C
It is complicated. The appellate judges do not read "the title sheet, the table of contents, the table of authorities, the certificate of compliance, the certificate of service, signature blocks" but use those to jump around or find things. The certificates are checked by the clerks and do not influence how a case is decided but rather whether the brief meets the rules for submission.

When I first started practicing, briefs were printed professionally and the page count was sufficient. The idea is to keep lawyers writing these things succinct in their arguments.