Send email from excel based on a condition (outlook 2007)

Status
Not open for further replies.

sn152

Member
Outlook version
Outlook 2007
Email Account
Exchange Server
Hi All,

I have a workbook which has data upto column N.

Column J has got the email IDs.
Column A has got the Item IDs.
Column M shows the age if each item ID.
Column N shows whether the age of item ID is greater than 1.

Now what I want to do is to automatically send emails for the Item IDs which have the age greater than 1 to the respective persons email ids listed in column J.

If one person is working on multiple Item IDs only single email should be sent listing all the Item Ids worked by that person.
Note: Email IDs might change everytime.


Please help me on this.

Thanks in advance.
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
If one person is working on multiple Item IDs only single email should be sent listing all the Item Ids worked by that person.
This would be the hard part. Creating the message and checking the age is easy - a basic macro is here http://www.slipstick.com/developer/code-samples/create-messages-using-data-excel-file/ and you'd start with an if statement checking the value in column N.
Putting them into one message per id could be done one of several ways - these are two that come to mind immediately.
1. sort by id and only start a new message if the id changes
2. loop through the sheet and look for a specific id - this would work best if you had a separate list of id's or marked off each record as used. The loop could check for unused records, then look for matching ids.
 
Status
Not open for further replies.
Top