View Single Post
 
Old 10-22-2012, 12:05 AM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

As you can see from the link, there is no {ADD} argument for OnKey. That's because there's no ADD key. However, you can use:
Code:
Sub ReAssignKeypad()
Application.OnKey "{096}", "KeyPad0"
Application.OnKey "{097}", "KeyPad1"
Application.OnKey "{098}", "KeyPad2"
Application.OnKey "{099}", "KeyPad3"
Application.OnKey "{100}", "KeyPad5"
Application.OnKey "{101}", "KeyPad5"
Application.OnKey "{102}", "KeyPad6"
Application.OnKey "{103}", "KeyPad7"
Application.OnKey "{104}", "KeyPad8"
Application.OnKey "{105}", "KeyPad9"
Application.OnKey "{106}", "KeyPadMult"
Application.OnKey "{107}", "KeyPadPlus"
Application.OnKey "{109}", "KeyPadMinus"
Application.OnKey "{110}", "KeyPadPoint"
Application.OnKey "{111}", "KeyPadDiv"
End Sub
Sub KeyPad0()
    MsgBox "You pressed: 0"
End Sub
Sub KeyPad1()
    MsgBox "You pressed: 1"
End Sub
Sub KeyPad2()
    MsgBox "You pressed: 2"
End Sub
Sub KeyPad3()
    MsgBox "You pressed: 3"
End Sub
Sub KeyPad4()
    MsgBox "You pressed: 4"
End Sub
Sub KeyPad5()
    MsgBox "You pressed: 5"
End Sub
Sub KeyPad6()
    MsgBox "You pressed: 6"
End Sub
Sub KeyPad7()
    MsgBox "You pressed: 7"
End Sub
Sub KeyPad8()
    MsgBox "You pressed: 8"
End Sub
Sub KeyPad9()
    MsgBox "You pressed: 9"
End Sub
Sub KeyPadMult()
    MsgBox "You pressed: *"
End Sub
Sub KeyPadPlus()
    MsgBox "You pressed: +"
End Sub
Sub KeyPadMinus()
    MsgBox "You pressed: -"
End Sub
Sub KeyPadPoint()
    MsgBox "You pressed: ."
End Sub
Sub KeyPadDiv()
    MsgBox "You pressed: /"
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote