Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming VBA / July 2006

Tip: Looking for answers? Try searching our database.

script to clear out categories on incoming emails

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
gbonawitz@gmail.com - 27 Jul 2006 21:37 GMT
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
Michael Bauer - 28 Jul 2006 06:07 GMT
Am 27 Jul 2006 13:37:22 -0700 schrieb gbonawitz@gmail.com:

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.

Signature

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
[quoted text clipped - 25 lines]
>
> Thanks
gbonawitz@gmail.com - 31 Jul 2006 19:17 GMT
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!

> Am 27 Jul 2006 13:37:22 -0700 schrieb gbonawitz@gmail.com:
>
[quoted text clipped - 36 lines]
> >
> > Thanks
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2010 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.