I love the customizable "Quick Actions" at the top and I've set some up to move things to various folders or convert messages to appointments, etc. One thing I still can't figure out how to do, though, is have a button that will select all messages in a folder, and move them to another specified (preconfigured) folder.

Basically, from my inbox, I want a single button to move all my mail into another folder for me, without having to hit Ctrl+A to select them all first.

Is this possible?

link|improve this question

75% accept rate
feedback

1 Answer

up vote 3 down vote accepted

It is possible; you'll need to write a macro to do it though.

From "Writing an Outlook Macro":

A macro is any public subroutine in a code module. A function or a private subroutine cannot be a macro, and a macro cannot be located in a class or form module.

To create a new macro

  1. In Outlook, point to Macro on the Tools menu, and then click Visual Basic Editor.
  2. In the Project window, double-click the module you want to contain the macro.
  3. On the Insert menu, click Procedure.
  4. In the Name box, type a name for the macro. The name cannot contain spaces.
  5. Click OK. (The template for the macro subroutine appears in the code module window).
  6. Type the code you want to run in the body of the subroutine.

Here's some example (untested) code to get you started:

Sub MoveItems() 

  Dim Messages As Selection 
  Dim Msg As MailItem 
  Dim NS As NameSpace 

  Set NS = Application.GetNamespace("MAPI") 
  Set Messages = ActiveExplorer.Selection 

  If Messages.Count = 0 Then 
    Exit Sub 
  End If 

  For Each Msg In Messages 
    Msg.Move NS.Folders("Personal Folders").Folders("SavedMail") 
  Next 

End Sub 
link|improve this answer
1  
With a little tweaking, and learning about Macros in Office 2010, I got this working. Thank you! – SpikeX Jul 29 '11 at 16:13
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.