• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 710
  • Last Modified:

macro or keyboard shortcut in outlook 2007

I'm looking for a way to map a key on my keyboard to automatically move whatever email I am viewing to a specific folder.
0
meixell
Asked:
meixell
  • 2
2 Solutions
 
stehardy88Commented:
You have to write a macro, assign a button on the toolbar, and then assign a shortcut to the button.
 
 For instance, to send the currently open email to the folder, create the macro:
 
 
 Sub MoveOpenMail()
     Dim oc As Object
     Dim myolApp As Outlook.Application
     Dim myNamespace  As Outlook.NameSpace
     Dim InboxFolder As MAPIFolder
     Dim DoneFolder As MAPIFolder
     Set myolApp = CreateObject("Outlook.Application")
     Set myNamespace = myolApp.GetNamespace("MAPI")
     Set InboxFolder = myNamespace.GetDefaultFolder(olFolderInbox)
     Set MoveToFolder = InboxFolder.Folders("FOLDERNAME")
     Set oc = Application.ActiveInspector.CurrentItem
 
     Select Case oc.Class
         Case olMail
             Set objMailItem = oc
             objMailItem.Move MoveToFolder
     End Select
 End Sub
 
 The code checks that the item is in fact a Mail item, and does not work for the currently selected item, but the currently open item.
0
 
stehardy88Commented:
Alternativy follow: http://www.experts-exchange.com/Software/Office_Productivity/Groupware/Outlook/Q_24013716.html to create the macro, then assign a button on the toolbar, and then assign a shortcut to the button.

Ste
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now