![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
I use categories to sort emails (and rules to automatically assign
categories to incoming email), and have custom search folders to display emails from each category. For those emails that I haven't assigned a category yet, I have a search folder that looks for emails with no category. This works great...unless other people have rules on outgoing email to assign categories that I don't have. Unfortunately, I can't create a search folder who's filter is "Category my_category 1 OR my_category2", etc. So, I want to create a script-driven rule that first removes all categories on incoming email, then I can let my other rules run to assign my categories. I am an absolute Outlook macro beginner, but cobbled together the following code from samples in this group and other websites... (this is just test code to see if I can manipulate the categories correctly) Sub test2(Item As Outlook.MailItem) MsgBox "Mail message arrived: " & Item.Subject Item.Categories = "Greg" Item.Save End Sub I have a rule to run this script first on every incoming email. However, it doesn't appear to work - I don't even get the msgBox (a test line), let along the test category assignment. Can someone help? Thanks |
Ads |
#2
|
|||
|
|||
![]()
Am 27 Jul 2006 13:37:22 -0700 schrieb :
Did you write that code into the module "ThisOutlookSession"? Additionally, the security setting must be medium at least to allow scripts, then please restart Outlook. -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook -- www.VBOffice.net -- I use categories to sort emails (and rules to automatically assign categories to incoming email), and have custom search folders to display emails from each category. For those emails that I haven't assigned a category yet, I have a search folder that looks for emails with no category. This works great...unless other people have rules on outgoing email to assign categories that I don't have. Unfortunately, I can't create a search folder who's filter is "Category my_category 1 OR my_category2", etc. So, I want to create a script-driven rule that first removes all categories on incoming email, then I can let my other rules run to assign my categories. I am an absolute Outlook macro beginner, but cobbled together the following code from samples in this group and other websites... (this is just test code to see if I can manipulate the categories correctly) Sub test2(Item As Outlook.MailItem) MsgBox "Mail message arrived: " & Item.Subject Item.Categories = "Greg" Item.Save End Sub I have a rule to run this script first on every incoming email. However, it doesn't appear to work - I don't even get the msgBox (a test line), let along the test category assignment. Can someone help? Thanks |
#3
|
|||
|
|||
![]()
Hi Michael-
1) OK, I hadn't previously been editing "ThisOutlookSession". I copied my code to there. 2) I changed the zone to Medium. Now it's working. Thanks for the tip! Michael Bauer wrote: Am 27 Jul 2006 13:37:22 -0700 schrieb : Did you write that code into the module "ThisOutlookSession"? Additionally, the security setting must be medium at least to allow scripts, then please restart Outlook. -- Viele Gruesse / Best regards Michael Bauer - MVP Outlook -- www.VBOffice.net -- I use categories to sort emails (and rules to automatically assign categories to incoming email), and have custom search folders to display emails from each category. For those emails that I haven't assigned a category yet, I have a search folder that looks for emails with no category. This works great...unless other people have rules on outgoing email to assign categories that I don't have. Unfortunately, I can't create a search folder who's filter is "Category my_category 1 OR my_category2", etc. So, I want to create a script-driven rule that first removes all categories on incoming email, then I can let my other rules run to assign my categories. I am an absolute Outlook macro beginner, but cobbled together the following code from samples in this group and other websites... (this is just test code to see if I can manipulate the categories correctly) Sub test2(Item As Outlook.MailItem) MsgBox "Mail message arrived: " & Item.Subject Item.Categories = "Greg" Item.Save End Sub I have a rule to run this script first on every incoming email. However, it doesn't appear to work - I don't even get the msgBox (a test line), let along the test category assignment. Can someone help? Thanks |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Graphics in incoming emails are suppressed | Big Al-Bob | Outlook Express | 2 | July 15th 06 10:35 PM |
Receive multi-copies of incoming emails? | wendystation | Outlook - Using Contacts | 9 | May 3rd 06 02:27 PM |
How do I clear deleted emails from my inbox for good? | Ryan | Outlook - General Queries | 1 | May 3rd 06 12:30 AM |
Assigning Categories to Emails | Keith Brown | Outlook and VBA | 1 | February 15th 06 02:42 PM |
How do I get incoming emails without the side arrows | Kate at work | Outlook - General Queries | 0 | February 9th 06 03:32 AM |