1.

Solve : Outlook 2003 macro to send multiple e-mails with different attachments?

Answer»

Is there a way to do this?  I've created an Excel macro to consolidate commission reports and to create a separate Excel workbook for each salesperson.  Now I want to create an e-mail  that attaches a workbook and sends it to the correct salesperson using a macro in Outlook 2003.  Or is there a way to do this in Excel 2003?

Can anyone give me the code to do this?

Thanks!
TrishMail merge techniques come to mind here.  But, I think your requirements are more complicated than a typical mail merge where, let's SAY, a certain Word document is sent to a list of recipients in an Excel file or an Access database. 

If I understand you correctly, you have a separate Excel file for each salesperson.  Is that right?  Are the NAMES of those files based on the name of the salesperson? 

How would Outlook get the names to send to?  Are all salespersons in an address book or Contacts list that includes no one else?  Do you have contact info for the salespersons in a separate Excel file or an Access database?

I don't know whether I can offer a SOLUTION once you answer these questions, but I think the answers are probably necessary before anyone can help you.Thanks for taking the time to reply to my post.  Yes, I have several Excel files --each named the same name as the salesperson ID.  I don't currently have the salespeople in a distribution list, but that could be done.  The only hitch is that there may or may not be a report to send to each salesperson in any given month.

I'm really looking for the easiest solution to mail these out.  I tried recording a macro in Excel to create an e-mail attachment of each salesperson's workbook and send it, but it did not record the Outlook piece.  Since posting my original REQUEST I've found some code that calls the Outlook application directly in Excel, completes the e-mail fields with variable results, and attaches a workbook, which may solve my problem.  I've already configured Excel to process through a unique list of salespeople who had activity for that month to create the spreadsheets, so I'm going to add the code I've found to that and see if I can get it to work.   

Now I just need the command to send the e-mail, and I think I'll be set.  I'll post the finished code here in case anyone else has any desire to do the same thing.



Discussion

No Comment Found