
You can press the ? key to quickly display some keyboard shortcuts that are available for the screen you're viewing. A tooltip will display with the shortcut key. If a button has a keyboard shortcut, you can find it by hovering your mouse over the button. #IfWinActive - Microsoft Outlook ahk_class rctrl_renwnd32, NUIDocumentWindowĪ::HandleOutlookKeys("!.Keyboard shortcuts let you quickly perform an action directly from your keyboard rather than with your mouse or touchpad. a user types this string into the subject of a message or task). ' - Microsoft Outlook' in the title, which will not appear in the title (unless on any other items except the main window.

As best I can tell, the window text 'NUIDocumentWindow' is not present

SetTitleMatchMode 2 allow partial match to window titles SendMode Input superior speed and reliability. You'll need to remove it if copying and pasting.
#OUTLOOK ARCHIVE HOTKEY CODE#
Important! - I put a space in front of RichEdit20WPT2 in the ctrlList variable so that this code would wrap on these forums. But of course I also needed to do this selectively, as I anticipated needing to actually use my 'a' key when typing emails. I chose alt + period (.) for this shortcut, so now all I needed was a way to have AHK send these keys to outlook when I pressed the 'a' key. This is explained in the link above where I mentioned getting the idea. Keep in mind that for the purposes of getting this to work with AutoHotKey, I had to create a button on the toolbar and assign a keyboard shortcut to call the macro. 'I could have cleared the msg flag, but I like to leave them.

Works for the inbox and all other folders not referenced above. 'Otherwise set to a default archive (Personal Received). 'if current subfolder is another subfolder you want to watch 'Set Archive Folder depending upon the current subfolder of the inbox Set Personal_Received = Application.GetNamespace("MAPI").Folders("Personal Folders").Folders("Mail").Folders("Personal Received") Set Business_Received = Application.GetNamespace("MAPI").Folders("Personal Folders").Folders("Mail").Folders("Business Received") Set Business = Application.GetNamespace("MAPI").Folders("Personal Folders").Folders("Inbox").Folders("Business") If ( = 0) Or (currentFolder inbox And currentFolder.Parent inbox) Then 'Exit macro if no messages are selected OR we're not in the inbox or a child of the inbox (For some reason, currentFolder.Parent in the To-Do List was causing errors.) 'This little hack prevents error if macro is run from the To-Do List. 'Exit macro if the currentFolder has a default item type of anything other than 0 (mail) Set inbox = Application.GetNamespace("MAPI").GetDefaultFolder(6)
#OUTLOOK ARCHIVE HOTKEY HOW TO#
Again, see the above link for how to add macros to Outlook. Here's what the outlook macro code looks like. So what I wanted was a way for the archiving function to send messages in Inbox/Business to Mail/Business Received, but send all other messages to Mail/Personal Received. Rules move emails into a subfolder if it comes through certain accounts or matches certain criteria. This can of course be adapted to your own needs, but I thought it helpful to see what I've done to understand the code. utton.htmlīefore proceeding further, let me illustrate how my inbox and archives folders are organized.

I'll start with the Outlook macro that does the actual email handling.
#OUTLOOK ARCHIVE HOTKEY WINDOWS#
I just also add that I tested this with Outlook 2007 and Windows Vista, though it may well work out of the box in other recent versions of Outlook. A combination of an Outlook macro (which does the actual moving of emails) and an AHK script (which calls this macro with a single keystroke) does just that. I wanted to ability to hit any key, say the 'a' key and have my message in Outlook be moved to an archive folder. Hello, I wanted to share a script that gives me something I've been wanting for a very long time.
