Showing posts with label QuickArchive in Outlook. Show all posts
Showing posts with label QuickArchive in Outlook. Show all posts

QuickArchive: More About Gmail-like Archive in Outlook


Expanding upon this earlier post, I started using AutoHotkey so that Shift Right-Clicking a message in Outlook archives it and Ctrl Right-Clicking deletes it. To do so, I changed the toolbar name for the ArchiveSelected macro to "&QuickArchive" (without quotes). An ampersand in a toolbar item name underlines the following character so that the button may be "clicked" via a keyboard shortcut: in this case Alt-Q. Why "Q"? Well, every other letter I tried was already taken by a menu or another toolbar item.

Then, I added the following to my main AHK script:
#IfWinActive ahk_class rctrl_renwnd32
+RButton::
Send {Click}
Send !q
return
^RButton::
Send {Click}
Send ^d
return
#IfWinActive

Add Gmail-like "Archive" and "Move to Inbox" Buttons to Outlook


The blog Techdem has instructions for adding a "Done" button to Microsoft Outlook. I've modified the macro code from those instructions and made similar buttons for the toolbars of message windows:

Sub ArchiveSelected()
Set ArchiveFolder = Application.GetNamespace("MAPI"). _
GetDefaultFolder(olFolderInbox).Parent.Folders("Archive")
For Each Msg In ActiveExplorer.Selection
Msg.UnRead = False
Msg.ClearTaskFlag
Msg.Move ArchiveFolder
Next Msg
End Sub

Sub ArchiveActive()
Set ArchiveFolder = Application.GetNamespace("MAPI"). _
GetDefaultFolder(olFolderInbox).Parent.Folders("Archive")
Dim myItem As Object
Set myItem = Application.ActiveInspector.CurrentItem
myItem.UnRead = False
myItem.ClearTaskFlag
myItem.Move ArchiveFolder
End Sub

Sub MoveActiveToInbox()
Dim myItem As Object
Set myInbox = Application.GetNamespace("MAPI"). _
GetDefaultFolder(olFolderInbox)
Set myItem = Application.ActiveInspector.CurrentItem
myItem.Move myInbox
End Sub

Sub MoveSelectedToInbox()
Set myInbox = Application.GetNamespace("MAPI"). _
GetDefaultFolder(olFolderInbox)
For Each Msg In ActiveExplorer.Selection
Msg.Move myInbox
Next Msg
End Sub



Updates: Please see QuickArchive in Outlook for more.

Ctrl-RightClick to Delete Messages in Outlook

An amendment to previous posts:
#IfWinActive ahk_class rctrl_renwnd32
^RButton::
MouseGetPos, , , , pane
If pane = SUPERGRID1
Send {Click}^d
else
Click right
return
RButton::
MouseGetPos, , , , pane
If pane = SUPERGRID1
Send {Click}!q
else
Click right
return
#IfWinActive

Right-Click to QuickArchive in Outlook

The following AutoHotkey code makes right-clicking a shortcut for QuickArchiving in Outlook, but (helpfully) only if a message is being right-clicked. Otherwise, there is normal right-clicking behavior.


#IfWinActive ahk_class rctrl_renwnd32
RButton::
MouseGetPos, , , , pane
If pane = SUPERGRID1
Send {Click}!q
else
Click right
return
#IfWinActive