Missing Keystrokes in Word 2010 RRS feed

  • Question

  • I have a java application which is listening to com events from word using comfyj (a com to java bridging library).

    I've noticed that on word 2010 any keystrokes that are entered by the user whilst I am processing a com event are lost.

    On earlier versions of word (2007 and 2003) these keystrokes are not lost and reach word as normal once the event handling is complete.


    Does anyone have any ideas about how I can get word 2010 to behave in the same way as earlier versions with regard to keystroke buffering during event handling?

    Monday, January 24, 2011 10:36 AM

All replies

  • Hello Peter,

    Your problem description gives little information about the actual Word 2010 events your application is processing. So the information below is somewhat general.

    Word 2010 throws many more events than earlier versions.  Your problem may relate to that fact. The keyboard strokes are messages to the WinWord Windows message loop, so it's possible the java application or comfyj is diverting those. If comfyj or the application uses marshalling, that blocks messages until the called method is out of scope.  There will be a difference between marshalling synchronously and asynchronouly. In order to understand what is happening with Word 2010 you could build an Excel VBA macro that uses getObject ( , "Word.application") and proceeds to sink events from that object. The event handler goes into a while loop to give you time to enter keystrokes, then see if the characters show up in the document when the handler breaks out of the loop.

    You need to declare the oWord object withevents in the Excel module at the global level.

    If this test shows that the keystrokes are not lost when your VBA module is processing events then the problem may result from the java component.

    If this does not help then because of its complexity your question falls into the paid support category which requires a more in-depth level of support.  The support engineers aren't familiar with java, so would appreciate your VBA demonstration, and can give you meaningful assistance more quickly. Please visit the below link to see the various paid support options that are available to better meet your needs.;en-us;offerprophone.

    Friday, February 11, 2011 10:39 PM
  • Thanks for the response.

    I tried the vba event handler with a while loop on selection changed events and keystrokes are not lost.

    I'll try comfyj support again with this new evidence.

    Many Thanks


    Friday, February 18, 2011 11:52 AM