https://vid.me/D105
Code: Select all
RegRead, OutLookVer, HKCR, Outlook.Application\CurVer
; Required for Outlook 2013
if OutLookVer = Outlook.Application.14
{
; Outlook 2010
ControlFocus, _WwG1, Untitled - Message (HTML) ahk_class rctrl_renwnd32 ; Set focus on the email body
SendInput, %body%
}
else if OutLookVer = Outlook.Application.15
{
; Outlook 2013
ControlFocus, RichEdit20WPT4, Untitled - Message (HTML) ahk_class rctrl_renwnd32 ; Set focus on the subject line
Send {Tab}
clipboard = %body%`r`n
Send ^v
}
; Mark email as high importance
SendInput, {Alt}h
SendInput, H
RegRead, OutLookVer, HKCR, Outlook.Application\CurVer
; Required for Outlook 2013
if OutLookVer = Outlook.Application.14
{
; Outlook 2013
OnMessage(0x44, "Center_MsgBox_Email_14")
MsgBox, 4, Attachments, Would you like to add any attachments?, 25 ; 25-second timeout.
IfMsgBox, Yes ; User pressed the "Yes" button.
{
Sleep, 1000
SendInput, {Alt}n
SendInput, AF
WinWait, Insert File ahk_class #32770
IfWinNotActive, Insert File ahk_class #32770
WinActivate, Insert File ahk_class #32770
WinWaitActive, Insert File ahk_class #32770
Sleep, 500
SendInput, M:\BILLING\Manual Invoices (RIMS) ; Folder to open
SendInput, {Enter}
}
ExitApp
IfMsgBox, No ; User pressed the "No" button.
ExitApp
IfMsgBox, Timeout ; i.e. Assume "No" if it timed out.
ExitApp
; Otherwise, continue:
}
else if OutLookVer = Outlook.Application.15
{
; Outlook 2013
OnMessage(0x44, "Center_MsgBox_Email_15")
MsgBox, 4, Attachments, Would you like to add any attachments?, 25 ; 25-second timeout.
IfMsgBox, Yes ; User pressed the "Yes" button.
{
Sleep, 1000
SendInput, {Alt}n
SendInput, AF
WinWait, Insert File ahk_class #32770
IfWinNotActive, Insert File ahk_class #32770
WinActivate, Insert File ahk_class #32770
WinWaitActive, Insert File ahk_class #32770
Sleep, 500
SendInput, M:\BILLING\Manual Invoices (RIMS) ; Folder to open
SendInput, {Enter}
}
ExitApp
IfMsgBox, No ; User pressed the "No" button.
ExitApp
IfMsgBox, Timeout ; i.e. Assume "No" if it timed out.
ExitApp
; Otherwise, continue:
}