Saving sent email to specific folder based on category with wildcard

bifjamod

New Member
Outlook version
Outlook 2013 32 bit
Email Account
Exchange Server
I am currently using Apple Mail, but getting ready to transition back to OL2013 after about 7 months. There are simply too many quirks, bugs and inefficiencies with Apple Mail to continue using it. That said, there's a few things that are also good about Apple Mail. One of those is their rules handling, which allows more creativity.

For my instant case, I tag many of my outbound emails with a 5 digit file number (this will use the category field in OL via Standss's EmailTags). With Apple Mail, I have a rule that states that any email with a keyword (Apple's version of "category" for this purpose) that starts with the number 2 gets moved to "Files" after being sent. This is significantly different from OL, which only gives the option that the category contains or matches.

Because I do not want all emails which contain the number 2 in the category to be so filed, only the ones that start with, I need a better way of processing this in OL. (It's only been 7 months, but I really don't remember how I dealt with this previously in OL - I must have manually selected the "save sent email to" folder for each one...how tedious!!)

I've looked at the various rules manager plugins on the market, but none seem to address the possibility of adding additional rules qualifiers such as "starts with" or using wildcards (i.e. "category matches 2****). Thus, the likely solution I am seeking is probably VBA based.

I have extensive experience with VBA in Excel, but only once in Outlook, and that being years ago. So, I am looking for any OL VBA aficionados who can (a) understand what it is that I am after and (b) give me some ideas and guidance on accomplishing this.

Also, to be clear, I will be using OL2013 on Win7, not the version for Mac (I am running Windows on a virtual machine on my Mac.)

Thank you all, and Merry Christmas!
 

Michael Bauer

Senior Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server
If the folders are in the default store, it's pretty simple. See the ItemSend event, which is explained in the VBA help file. It triggers when you hit the Send button. In that event check the item's Categories property. First I'd ignore that an item could have more than one category assigned.
Code:
select case left$(item.categories,1)
case "1": 'maybe do something
case "2": 'here set the SaveSentMessageFolder property
end select
The SaveSentMessageFolder prperty is also explained in the help file.
 
Top