I want to do similar thing in Lotus Notes too. I've revisited clangford1174's code based on MCL's advice as below. It works on my Win7 machine.
!NumpadDiv::
{
Send ^P ; CTRL+SHIFT+p forces System Print Dialog
WinWait, Print, , 2 ; Wait for Print Dialog to appear
if ErrorLevel
{
MsgBox, WinWait timed out.
return
}
else
{
ControlSetText, Edit4, 1
Send {Enter}
}
return
}
BTW, This thread on selecting printer with AHK is relevant too. How to select printer and print with AutoHotKey