Hi Jerry,
In theory, yes, you can use it. In practice, SendKeys has a reputation
for flakiness. Sometimes the keystrokes go off into the ether, and
sometimes they get routed to the wrong window. It often doesn't work
in single-step mode (F8) in the editor but the same code will work if
you just launch the macro (F5).
You're generally safe if the SendKeys is *immediately* followed by the
.Show or .Display statement, which is best assured by using the colon
as a statement separator like this:
With Dialogs(wdDialogWhatever)
SendKeys "%a" : .Display
End With
I also try to keep the number of keystrokes in the SendKeys argument
to the bare minimum. Sacrificing a chicken under a full moon may help,
too. :-)
--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
>Hi Jay,
>
[quoted text clipped - 56 lines]
>> >
>> >Jerry Bodoff
JBNewsGroup - 11 Apr 2005 05:44 GMT
Hi Jay,
Thanks for your comments. It works fine.
Also, the "chicken ritual" helped.
Jerry Bodoff
> Hi Jerry,
>
[quoted text clipped - 81 lines]
> >> >
> >> >Jerry Bodoff