none
Using SendKeys RRS feed

  • Question

  • I want to send Ctrl+Alt+N, then Alt+E to bring up a Word addin macro that I don't have access to by name.

    I can't seem to find the right syntax.  I've tried SendKeys "^%N" and other similar combinations using () and {} but no success.

    Please advise.

    Friday, April 20, 2012 6:49 PM

Answers

  • Copied from the reference:

    "To specify that any combination of SHIFT, CTRL, and ALT should be held down while several other keys are pressed, enclose the code for those keys in parentheses. For example, to specify to hold down SHIFT while E and C are pressed, use "+(EC)". "

    The Shift key is a + sign, the CTRL key is a ^ sign, and the ALT key is a % sign.

    I tried the following code and it worked in Word 2010 for me.

       

        SendKeys "^(h)"


    Kind Regards, Rich ... http://greatcirclelearning.com


    Friday, April 20, 2012 9:38 PM

All replies

  • This link to the SendKeys Statement in the Developer Reference should help.

    Kind Regards, Rich ... http://greatcirclelearning.com

    Friday, April 20, 2012 9:14 PM
  • Already saw that one.  Did not show how to include Ctrl+Alt.  Fact is, can't get the Ctrl (using a ^) to work with any keystroke.
    Friday, April 20, 2012 9:24 PM
  • Copied from the reference:

    "To specify that any combination of SHIFT, CTRL, and ALT should be held down while several other keys are pressed, enclose the code for those keys in parentheses. For example, to specify to hold down SHIFT while E and C are pressed, use "+(EC)". "

    The Shift key is a + sign, the CTRL key is a ^ sign, and the ALT key is a % sign.

    I tried the following code and it worked in Word 2010 for me.

       

        SendKeys "^(h)"


    Kind Regards, Rich ... http://greatcirclelearning.com


    Friday, April 20, 2012 9:38 PM