Outlook Execute Macro

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
pr4t3ek
Newbie
Posts: 4
Joined: Thu Dec 18, 2008 11:42 am

Outlook Execute Macro

Post by pr4t3ek » Wed Dec 24, 2008 6:56 am

Hi,
I don't think this is possible but is there a way to execute a macro when I receive a e-mail in outlook 2003 with a specific phrase in the subject line.

I'm trying to automate a report but the data comes to me via an e-mail etc...

Can this be implemented?

Lets say the phrase in the subject line is "ReportData 24-12-2008" ...

armsys
Automation Wizard
Posts: 1108
Joined: Wed Dec 04, 2002 10:28 am
Location: Hong Kong

Post by armsys » Wed Dec 24, 2008 10:24 am

Have you tried using Tools | Rules and Alerts... in Outlook first?

pr4t3ek
Newbie
Posts: 4
Joined: Thu Dec 18, 2008 11:42 am

Post by pr4t3ek » Wed Dec 24, 2008 1:19 pm

well what i had in mind was:

when a email with a specific subject comes through, i would somehow like to download the attachment and save it to my desktop and then run some scripts etc with that file...


what do we think?

maybe i dont know the outlook rules too well, maybe there is a way to save it to desktop?

Aaron
Pro Scripter
Posts: 113
Joined: Mon Apr 09, 2007 1:35 am
Location: Wyoming

Post by Aaron » Thu Jan 08, 2009 2:32 am

yes

the very first script I wrote did this exact thing.

What exactley do you want it to do?

I had the subject line indicate the customer number, it would then put the email into the customer folder and change their webpage as specified by the attachment.

If you need help please indicate your system, xp, vista.
Aaron

Danish_Ken
Junior Coder
Posts: 22
Joined: Mon Sep 12, 2005 1:34 am
Location: Melbourne - Australia

Post by Danish_Ken » Tue Jan 13, 2009 4:09 am

Hi Aaron,
Using WinXP sp2 with Outlook 2003

Had something similar in mind. Very interested in how you achieve this, if you don't mind sharing?

Thanks in advance
/Ken

Aaron
Pro Scripter
Posts: 113
Joined: Mon Apr 09, 2007 1:35 am
Location: Wyoming

Post by Aaron » Tue Jan 13, 2009 4:50 pm

If you can tell me exactly what you would like to do that would help.

Do you really need to move it to the desktop?

You should be able to do move the file straight to a folder from outlook and do with it all you actions from there.

Try going through the process manually taking down notes of each and everything you do.
then post it to this form.

I will then help with your script.
Make sure and post what you have so far.
Aaron

Danish_Ken
Junior Coder
Posts: 22
Joined: Mon Sep 12, 2005 1:34 am
Location: Melbourne - Australia

Post by Danish_Ken » Thu Jan 15, 2009 1:35 am

Thanks Aaron,

The action would be somthing like:
  • Receive Email with attachment (xls or csv)
    Save attachment to folder d:\temp
    Run MSAccess database to process attachment
I'm mostly interested in the method to extract the file attachment from OL 2003

Cheers
/Ken

Aaron
Pro Scripter
Posts: 113
Joined: Mon Apr 09, 2007 1:35 am
Location: Wyoming

Post by Aaron » Fri Jan 16, 2009 4:39 am

Im using vista now but you can write down every step you take to do this manualy and then code the steps.

Im not sure if this can be done while outlook is minumized or not.

After thinking about it I used a perl script to copy to a differant folder but you can do this with ms if you want.

just set outlook to check your mail every so often, say 5 minutes.

Have your script trigger if a new file is in folder inbox.

then write your script to check the subject line, if they match have the file moved and do whatever it is you want it to do.

I cant really help you any further unless you start writing your script and post where you are having problems, and what it is next you need to do in your script.

My best addvice again would be to go through it manualy, use as many keyboard shortcuts as possable.
Keep good notes and start your script from there.

Good luck
Aaron

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts