Thank you Peter. I sincerely appreciate the well thought-out response.
I think your example actually provides a discussion opportunity, because -- while there may be circumstances where someone needs unusual considerations taken into account to come up with the total number of words in a document, it appears to me that Microsoft
already has settled on a particular combination of those considerations as a "standard" for doing that and, using that standard, has included in Word a tool that provides an answer to that question (as as well as how many characters & spaces are in the document).
So -- to me -- counting the words in a document provides an example of something that
could be done by a macro, but where MS has decided to make it easier for the user to get the basic information by "hard-coding" some standard assumptions about what is and is not a "word" and then providing the number. If MS also happened to mention
that its assumptions did not count any "Non-joining-oojamaflip" and the IT Journalist knew he really needed those counted, then that would be a good reason why he would need to come up with a macro that included all of the complexities you reference.
So let's say Microsoft had not already happened to have thought to include "word count" within Word and the only way users could get
any count of the total number of words in their document was to write their own macro that would have to take into account ALL of the unusual ""Non-joining-oojamaflip"-type considerations. In the first place, there would be an awful lot of users who
would give up and use the old "print it out and manually count" method. Then there would be others who would try to use the macro language to do it, with varying degrees of success. At some point, I've got to believe enough people would say to Microsoft
"I don't care about the "Non-joining-oojamaflip" -- count it or not and make whatever standard assumptions you deem appropriate, but please just find a way to give me a standardized (you pick the standard) count without my having to program a complicated macro."
That's the way I feel about providing a tool that will make a macro do whatever it does over and over within a document UNTIL it has reached the end of the [paragraph; section; page; or document]. And then, MS should identify the limitations of the tool (e.g.,
"This option [will or will not (frankly, I don't care, just tell me)] affect headers, footers, footnotes, endnotes, comments [or whatever] that may be encountered in the document.).
You asked a couple of questions that I don't know that I understand well enough to try to answer:
a. how do we define what exactly a Word macro language should be able to do? Even at
its simplest, "What questions should the macro language enable you to answer?"
To me, it's not what the macro language itself should be able to do, but whether and what additional tools can be provided that could automate and maximize the accessibility of the macro capability for the benefit of more users.
b. if the macro language just had to be able to deal with the example you give, what would
it really have to do (in the general case, bearing in mind that a document isn't just a single
stream of text, ya da da...)
Well, as I said before, I would propose that a button or checkbox Option be added to "Repeat application of this macro to all text in", next to which would be radio buttons for choosing between:
- this entire paragraph
- this entire page
- this entire section
- this entire document
- Selection of any of which would activate checkboxes to have it also apply within any encountered:
- header
- footer
- footnote
- endnote, or
- comment
Not being a programmer, (and like Donald Rumsfeld) there probably are considerations that are "known unknowns" to me, but which a programmer addressing this would "know" to take into account.