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.