PDA

View Full Version : Downloading attachment from a specific user's email to hard disk, deleting the mail



maryam_ahmed
03-15-2010, 10:44 AM
hi all,
can someone here help me to provide some code which could automate an excel-outlook task.. i think i should eleborate what i want from the macro:

step1: after clicking a button within my worksheet, it should go to my outlook email inbox( in background process, no need to open the outlook in front of me)

step2: check for a specific email from a specific person WITH A SPECIAL SUBJECT LINE. lets supposse the macro should search for an email sent to me from the email address abc@mycompany.com with a subject "DATA UPDATE". the macro should not be concerned with any other email from abc@mycompany.com.

step3: get the attachment files from that email , save the attachments to my "c:\abc_folder" and then DELETE THAT EMAIL from which i had downloaded the files. Meanwhile the macro should not give pain to any of the other emails sent from the same abc@mycompany.com with different SUBJECTs...

this was all, an additional thing could be this, that if there is no any email with from abc@mycompany.com with a subject DATA UPDATE. then the macro should give a msg box "No updated files were found" , and if it finds the specific email and attachments, it should tell " 8 FILES DOWNLOAD"

I believe it is simple enough but as i am not a programmer....i would really appriciate your help....

maryam_ahmed
03-16-2010, 05:32 AM
has someone done it...?

GTO
03-16-2010, 10:42 AM
Greetings Maryam,

Say, I see that you recently joined and that this was your first posting here. Please let me say Welcome as well as a friendly 'Howdy' from Arizona :-) As I have mentioned to others, you will be happy you joined vbax. It is a great place to learn; as there's just some great folks here who go out of their way to be helpful.

As to your request, presuming this is an 'at work' task, as long as Outlook is already open, I do not think that you would have too much difficulty in a solution. Given your statement that you are 'not a programmer', I take it that you might be a little newer to vba and are looking to learn.

In that light, might I suggest that it would be easier to first learn how to do this in Outlook, then if it seems advantaguous, add/alter the code to run it from excel. Does that make sense?

Mark