The second line is broken in a couple places.  It needs to look like this:

SetRegisteredKey = Keyboard.RegisterHotKey("Control-Shift-Windows-R", "SpeakHelloWorld" )

The close parenthesis was in the wrong place, and the bit after the comma should have been the name of the function in quotes. (All of which sounds exactly the same, so it's an easy mistake to make.)


Jeff Weiss wrote:
I am trying to take examples from the scripting manual and making them run.
I seem to have the syntax of this one wrong.
Any suggestions welcome!
' Create a hot key using a string SetRegisteredKey = Keyboard.RegisterHotKey("Control-Shift-Windows-R"), Speak "HelloWorld" Sub SpeakHelloWorld()
Speak "Hello world!"
End Sub

Reply via email to