Hi
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.
Roland
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
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.
Roland
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