Rules as VBA

S

Svilen

Recently I moved to MS Exchange Server account on my Outlook 2003 and
I was surprised that there is a limit for the rules that I could have
active. I used to have more than 60 rules and now I have right to run
only 25....
As I understand that the limitation is on the server side so there is
nothing I could do on my local Outlook rules wizard.
I'm searching for workaround and I think that I could do it by VBA.
I would ask for a help with some guidelines how to write my rules as
VBA code.
Thanks!
 
D

dch3

(Have to ask...)

Why do you need 60 rules? Are there some that are merely nice to haves -
such as automatically filing return receipts in a specific folder? Keep in
mind that if you go with VBA, they'll only run on your specific PC. If the
harddrive crashes or anything happens to the machine, they'll all be lost.
Not to mention that they'll only run when the machine's turned on and Outlook
is open.
 
S

Svilen

Thanks Sue,
Most of my rules are just as dch3 writes "automatically filing return
receipts in a specific folder". I need them because I receive a lot of
emails from different senders and it is very helpful for me to filter
them to specific folder.
Could you please help me to transform this code (it is on the page
that you refer to) to move the messages to some folder and not to make
them as plain text? And one more question, is it possible to run this
script apart from rules (to put it on a toolbar like a button, or run
it automatically)?

Sub ConvertToPlain(MyMail As MailItem)
Dim strID As String
Dim objNS As Outlook.NameSpace
Dim objMail As Outlook.MailItem

strID = MyMail.EntryID
Set objNS = Application.GetNamespace("MAPI")
Set objMail = olNS.GetItemFromID(strID)
objMail.BodyFormat = olFormatPlain
objMail.Save

Set objMail = Nothing
Set objNS = Nothing
End Sub
 
S

Svilen

Yes you are right but still I need some way to filter my emails
because it is easier to manage it. I don't need the rules on another
machine because the emails are saved locally on my machine. And if
anything happens with it the rules will be the last thing that I will
regret for :)
But please, let me know if you know a convenient way to manage
everyday mail on MS Outlook from more then 60 senders.

Thanks!
 
D

dch3

For starters, you can programically set the folder to which a copy of the
Sent Item is saved to (as opposed to the Sent Folder).

Information on the MailItem object and the property whose name I can never
remember
http://msdn.microsoft.com/en-us/library/aa210946(office.11).aspx
http://msdn.microsoft.com/en-us/library/aa171932(office.11).aspx

http://www.outlookcode.com/codedetail.aspx?id=456

I've worked with the property whose name I can't remember from within
Access. My guess is that you'd need script behind a custom IPM.Message form
to programmically set the folder and/or provide the folder selection dialog
to select the folder.

I'd also look at a simple Access database for use in looking up to which
folder a particular message to a person should be sent. You could either
place each person's name in the table with corresponding folder as in

txtEmail txtDestinationFolder

(e-mail address removed) Sent Message - Willard Madison, Inc

Or do something where its by domain name as in ...
txtDomain txtDestinationFolder
wms.com Sent Message - Willard Madison, Inc

Once you've got the lookup working for the outbound mail, it shouldn't be
too difficult to do the same for incoming messages.

I'd have three fields in the Access table - one for the email or domain, one
for the destination folder and one for the folder should be used for INBOUND
or OUTBOUND mail. That way you can save sent messages/outbound replies in one
folder and receipts/inbound replies in another.
 

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

Top