Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Com Addin for Word200 - weird problem - please help

0 views
Skip to first unread message

Martin McKay

unread,
Aug 18, 2000, 7:25:30 AM8/18/00
to
Hello Folks,

I'm working on a word addin, and have made great progress with 80% of it. I
have got a new toolbar with 10 ne buttons, and thay are all working fine,
but I have one "background" task which I'm using a timer for. Every so
often it has to examine the document, and set a variable based on the number
of spelling errors. The thing is if someone if typing when my timer kicks
in, word starts to duplicate keystrokes.

So I'll get text like "continnnnue" where the "n" key has been duplicated.
I have written a low level hook to monitor the keyboard, and no extra key
events are being generated. If I delcare a range, and set it to be equal to
the selection at an instant when someone is typing, I get unpredictible
results.

I have tried using "BlockInput" to prevent typing while my processing is
happening (just for a split second) but very occasionally I get a missing
keystroke.

Has anyone seen this happening, or does anyone have a workaround?

Thanks in advance,

Martin


Martin McKay

unread,
Aug 18, 2000, 11:31:25 AM8/18/00
to
I think I have solved the problem. My COM addin seems to run in a separate
thread from Word, but it calls words spellchecker quite often, and when this
happens during typing the errors occur.

It may be worth noting that to declare a word.document in a VB form, and
then call

Set frm_Main.doc_CurrentDocument = doc

during the NewDocument, or DocumentChanged events does give you a valid
pointer to the current document which you can use to manipulate the
document, but if the user is typing, or the document is not ""static" when
you are doing your processing, then problems do occur which are pretty
unpredictible.

I have a workaround for my own need now though.

Best Wishes,

Martin


0 new messages