Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Outlook 2003 macro to send multiple e-mails with different attachments  (Read 2589 times)

0 Members and 1 Guest are viewing this topic.

flg8rgal

    Topic Starter


    Newbie

    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!
    Trish

    soybean



      Genius
    • The first soybean ever to learn the computer.
    • Thanked: 469
    • Computer: Specs
    • Experience: Experienced
    • OS: Windows 10
    Re: Outlook 2003 macro to send multiple e-mails with different attachments
    « Reply #1 on: September 11, 2009, 11:02:27 AM »
    Mail 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.

    flg8rgal

      Topic Starter


      Newbie

      Re: Outlook 2003 macro to send multiple e-mails with different attachments
      « Reply #2 on: September 11, 2009, 01:15:40 PM »
      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.