0

our team has a shared mailbox in which we receive hundred of mails daily and we have to drag them manually from inbox into its separate sub-inboxes. So is there any rule or macro to drag them automatically.

1 Answers1

0

VBS sample

Set objOutlook = GetObject (, "Outlook.Application")
Set objNamespace = objOutlook.GetNameSpace ("MAPI")

Set objFolderRoot = objNamespace.Folders ("Y2013")

Set objFolderSource = objFolderRoot.Folders ("Inbox")
Set objFolderDistance = objFolderRoot.Folders ("test")

MsgBox "Total emails is Inbox folder: " & objFolderSource.Items.Count

Set objEmail = objFolderSource.Items (1)

MsgBox "Subject of first email: " & objEmail.Subject

objEmail.Move objFolderDistance

Set objEmail = Nothing

Set objFolderDistance = Nothing
Set objFolderSource = Nothing

Set objFolderRoot = Nothing

Set objNamespace = Nothing
Set objOutlook = Nothing

Of course you MUST add object validation in this code.

You could also take a look to VBA (not VBS which you are using) sample on http://msdn.microsoft.com/en-us/library/office/ff860683.aspx

Zam
  • 2,880
  • 1
  • 18
  • 33