Jump to content
Sign in to follow this  
Omatsei

Watch Outlook Messages?

Recommended Posts

Omatsei

Is it possible to automatically watch incoming messages in Outlook, and if certain criteria are met, do something with those messages? (In this case, I want to automatically save attachments to a custom folder, then remove the attachment from the message and replace it with an HTML link to the saved file... unless the message has the subject that starts with "Message From".)

Share this post


Link to post
Share on other sites
james3mg

Is it possible to automatically watch incoming messages in Outlook, and if certain criteria are met, do something with those messages? (In this case, I want to automatically save attachments to a custom folder, then remove the attachment from the message and replace it with an HTML link to the saved file... unless the message has the subject that starts with "Message From".)

Depending on your version of Outlook, this will almost certainly get flagged as suspicious behavior and blocked. You could try parsing the .pst file representing everything in your "personal folders", but I think outlook even blocks access to the file sometimes (ever synchronized a mobile device with outlook? That message that pops up and asks you if you want to allow or deny access is what I'm talking about).

The only way around it is to design a full-fledged plugin for outlook, and unless I'm mistaken (possible), you can't really pull that off in AutoIt.

I think that newer versions of Outlook might have the ability to save attachments from the "rules" you can create and check against all messages, but the attachment will still be in the message - I'm fairly sure you can't replace it with a link to an external file. So you may be able to get some of what you wanted...if that helps at all.


"There are 10 types of people in this world - those who can read binary, and those who can't.""We've heard that a million monkeys at a million keyboards could produce the complete works of Shakespeare; now, thanks to the Internet, we know that is not true." ~Robert Wilensky0101101 1001010 1100001 1101101 1100101 1110011 0110011 1001101 10001110000101 0000111 0001000 0001110 0001101 0010010 1010110 0100001 1101110

Share this post


Link to post
Share on other sites
Omatsei

I figured that the best and easiest way to do it is within Outlook itself, and since I only need to support XP, 2003, and 2007, the built-in VB Macros are the way to go.

The short version of the story is that we have an Exchange server, and everyone keeps their messages on the server (so they can easily access them remotely). Being in education, our faculty get a lot of attachments, which really adds up. The server admin guys were complaining a bit about the size of some people's mailboxes, so we needed a way to reduce the size... Archiving works, but then the whole message is only available on the local computer, which can lead to other problems. Anyway, I thought that using VB in a rule applied to all incoming messages would greatly reduce the size of their mailbox, while keeping the attachment accessible. The only problem now is how to create the macro and apply the rule.

I can create the macro in about 5 steps, then another 10 steps or so to create and apply the rule, but I'm wondering if there's an easier way. I know some of the Outlook controls can be controlled via AutoIt, which would be perfect, but I'm not sure exactly how to do it... The manual steps are basically:

1. Copy the script into the VB editor in Tools > Macros > VB Editor.

2. Save the VB Session.

3. Create a new rule and set all the appropriate options (applied to all incoming messages, run a script, specify the script, and specify exceptions to the rule).

Does anyone have any experience in automating the rules in Outlook with AutoIt?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.