Word 2007 - Excel.Application.SendKeys equivalent? -
05-12-2009
, 10:34 AM
Does anybody know if there is an equivalent of
Excel.Application.SendKeys for Word 2007? I'm using the DSOFramer
control and am trying to programmatically close a Print Preview window
before saving and closing a doc (otherwise the application throws a
"Cannot access document when in modal condition" exception), and while
I can poll the application to see if it IS in Print Preview mode, I
can't seem to do anything about it.
I figured the easiest thing to do would be to send an escape keystroke
to Word, and while this would be no problem in Excel, Word does not
seem to have this function (at least not in the Primary Interop
Assemblies; there is a VBA equivalent, but that's not a feasible
solution at this time). Does anybody have any ideas? Thanks! |