group emails by company in outlook

Asked By michael williams
22-Nov-09 12:02 AM
Earn up to 0 extra points for answering this tough question.
Is there a macro for grouping emails in a folder by sender in outlook?

  you can create rules in outlook

Venkat K replied to michael williams
22-Nov-09 05:50 AM

check this link how to create rule and move items to a folder based on some conditions:

http://office.microsoft.com/en-us/outlook/HP052428971033.aspx

 

  1. In the Navigation Pane (Navigation Pane: The column on the left side of the Outlook window that includes panes such as Shortcuts or Mail and the shortcuts or folders within each pane. Click a folder to show the items in the folder.), click Mail.
  2. On the Tools menu, click Rules and Alerts.
  3. If you have more than one e-mail account, in the Apply changes to this folder list, click the Inbox you want.
  4. Click New Rule.
    1. Click Start from a blank rule, and then click Next.
    2. Under Select when messages should be checked, select Check messages when they arrive or Check messages after sending, and then click Next.
  5. Follow the rest of the instructions in the Rules Wizard.

    If you want to run this rule on messages already in one of your folders, select the Run this rule now on messages already in "folder" check box on the last page of the Rules Wizard.

    To have this rule apply to all your e-mail accounts and Inboxes, select the Create this rule on all accounts check box on the last page of the Rules Wizard.

Thanks,

  You cannot record macros in Outlook, but you can execute certain VBA snippets.

[)ia6l0 iii replied to michael williams
22-Nov-09 11:27 AM
  • You need to go to Tools - Macro - Macros.
  • Type a name for the macro, choose "Create".
  • The VBA Editor would open, and place your vba code in the module.
  • Save and Exit.
Back, to your vba macro snippet: The snippet would look like below:

Sub SortBySenderName()
    Dim myOlApp As New Outlook.Application
    Dim myNameSpace As Outlook.NameSpace
    Dim myFolder As Outlook.MAPIFolder
    Dim myItem As Outlook.TaskItem
    Dim myItems As Outlook.Items
    Set myNameSpace = myOlApp.GetNamespace("MAPI")
    Set myFolder = myNameSpace.GetDefaultFolder(olFolderInbox)
    Set myItems = myFolder.Items
    myItems.Sort "[SenderName]", False
End Sub

Do not forget to change the folder, and the field name if you want it to be sorted by something else. 

Remember, this is only for grouping. If you need routing specific emails to specific folders, then you would need to use Rules as described above by the other member.

thanks.
Create New Account