Using Item Add on Folder- How do you do it on more than one folder.

Feb 26, 2011
Reaction score
I hoping someone can point me in the right direction. I have successful set up some coding which uses the "ThisOutllokSession" and Application startup and ItemAdd to add a category to an email when it is moved into a particular folder. I now however want to do the same on another subfolder and add a different category. As the coding is as follows and when I repeat this for the other folder it will only work for the last folder in the script. How do I get both coding for each folder co-exist.

Thanks for any help with this.


Private Sub Application_Startup()
Dim Ns As Outlook.NameSpace
Dim Inbox As Outlook.MAPIFolder
Dim Subfolder As Outlook.MAPIFolder

Set Ns = Application.GetNamespace("MAPI") ' Inbox
Set Inbox = Ns.GetDefaultFolder(olFolderInbox)
Set Subfolder = Inbox.Folders("1. Action") ' Subfolder of the inbox
Set Items = Subfolder.Items


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