Outlook Novice Question

Joined
Mar 12, 2009
Messages
1
Reaction score
0
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top