Hello all,
start off i never used VBA before and i was hoping to get some help here, am trying to get a script running in outlook where it would look through all of my inbox e-mail and move to sub folders.
The folders i want to move to are sub folders of inbox folder something like inbox > folder > folder. I been searching the net and came across this.
On Error Resume Next
Const olFolderInbox = 6
Set objOutlook = CreateObject("Outlook.Application")
Set objNameSpace = objOutlook.GetNamespace("MAPI")
Set objInbox = objNameSpace.GetDefaultFolder(olFolderInbox)
Set objFolder = objInbox.Folders("singer").Folders("Tom Jones")
Set colItems = objInbox.Items
Set objItem = colItems.Find("[SenderName] = 'Tom Jones")
Do While TypeName(objItem) <> "Nothing"
objItem.Move objFolder
Set objItem = colItems.FindNext
Loop
Also is it possible to rather then using the sendername to use sender e-mail address for critiera?
Thanks
start off i never used VBA before and i was hoping to get some help here, am trying to get a script running in outlook where it would look through all of my inbox e-mail and move to sub folders.
The folders i want to move to are sub folders of inbox folder something like inbox > folder > folder. I been searching the net and came across this.
On Error Resume Next
Const olFolderInbox = 6
Set objOutlook = CreateObject("Outlook.Application")
Set objNameSpace = objOutlook.GetNamespace("MAPI")
Set objInbox = objNameSpace.GetDefaultFolder(olFolderInbox)
Set objFolder = objInbox.Folders("singer").Folders("Tom Jones")
Set colItems = objInbox.Items
Set objItem = colItems.Find("[SenderName] = 'Tom Jones")
Do While TypeName(objItem) <> "Nothing"
objItem.Move objFolder
Set objItem = colItems.FindNext
Loop
Also is it possible to rather then using the sendername to use sender e-mail address for critiera?
Thanks