Word 2007 Macro Help
I'm working on a school project on typing speed. In order to capture the user's characters per minute, I thought a Word macro would be useful, since they'll be typing only in Word.
I'm not looking to make a full keylogger -- simply something that counts how many characters the user has typed. I've searched for topics like this elsewhere, but they always seem to end开发者_StackOverflow with someone responding "We don't support this kind of coding" or something like that.
Could anyone point me towards a useful tutorial? I'm not so good with visual basic.
Well, word doesn't support any events to that you could hook into to track WHEN a use actually types characters, which would make it tough to track speed.
About the best you could do in native word macros would be to setup a timer, then, at regular timed intervals (say, every second) grab the activedocument, and check the length of the .content property.
that would be a pretty crude analog for chars per second though.
There's tons of stuff on word macros on the internet, just google "Word VBA examples" for a pile of 'em
精彩评论