PDA

View Full Version : [SOLVED] PRINT EMAILS WHERE SUBJECT MATCHES CELLS IN EXCEL



leemcder
02-23-2018, 03:30 AM
Hi Everyone,

I am looking for some help this may not be possible but I hope some has an idea! Basically I receive thousands of emails (outlook 2013) with subject "SF Bill sent to accounts - 123456" the 6 digits are different for every email, every email has an excel attachment which I need to print.

Is it possible that if I have a list in excel (2013), containing the subject of the emails that I want to print, that this can be done with a vba?

I basically want the list in excel with a list of subjects, I want these to print the attachment of the corresponding email in outlook.

Many thanks in advance.

Lee

ashleyuk1984
02-23-2018, 05:04 AM
I can't give you the exact solution that you're looking for, but how about looking at it this way....

You said that you receive thousands of emails with the subject of "SF Bill sent to accounts - 123456", and the 6 digits change every time. This makes it unique.

How about, setting up a macro in Outlook to automatically save these attachments to a local folder. The macro will trigger when you receive an email with the subject line that contains "SF Bill sent to accounts -"....
You could also add in another rule if these emails come from a specific email address.

So every time, you receive one of these emails, the attachment is saved to "C:\SF Bills"

The macro can automatically rename this file to your 6 digits... That's if the excel file name is always different, but not unique.

Then.... You can set up another macro in Excel, to look at your list of subjects, and then look for the file in your local drive... if it exists, then print it.

That's probably the way I'd go about it.

leemcder
02-23-2018, 05:33 AM
Thanks Ashley, this sounds like a good solution! I am pretty new to VBA so I will give it a try and cross my finger.


I can't give you the exact solution that you're looking for, but how about looking at it this way....

You said that you receive thousands of emails with the subject of "SF Bill sent to accounts - 123456", and the 6 digits change every time. This makes it unique.

How about, setting up a macro in Outlook to automatically save these attachments to a local folder. The macro will trigger when you receive an email with the subject line that contains "SF Bill sent to accounts -"....
You could also add in another rule if these emails come from a specific email address.

So every time, you receive one of these emails, the attachment is saved to "C:\SF Bills"

The macro can automatically rename this file to your 6 digits... That's if the excel file name is always different, but not unique.

Then.... You can set up another macro in Excel, to look at your list of subjects, and then look for the file in your local drive... if it exists, then print it.

That's probably the way I'd go about it.