Displaying multiple emails - they all go into one email?

Steph77

Board Regular
Joined
Sep 18, 2014
Messages
119
Hi - me again!

I'm trying to send emails to several suppliers based on the data from a workbook. I've got pretty much all the way there by myself but the problem I'm having is that I need to display the emails before sending and when I ask excel to display the emails it simply adds all the attachments into a single email instead of creating a new email for each attachment.

In case that wasn't clear, I have (for instance) 5 suppliers, A, B, C, D and E. I want to send 5 emails, one to each, containing the appropriate workbooks 1, 2, 3, 4 and 5. I need to make minor changes to the email body before sending so I need to display each email in turn. At the moment my code ends up displaying one email, addressed to E, with all 5 workbooks attached.

Is there any way to get VBA to tell outlook to open a NEW email message, instead of just adding onto the currently open draft message?

My code is as follows:

Code:
Dim OutApp As Object
Dim OutMail As Object

Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)

.... some other stuff....

... then inside a for next loop: ...

With OutMail
   .To = ActiveSupplierEmail
   .CC = EmailCC
   .BCC = ""
   .Subject = EmailSubject
   .Body = EmailBody
   .Attachments.Add (SupplierBookPath)
   .Display
End With

Many thanks in advance for any assistance :)
 

Some videos you may like

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)

Steph77

Board Regular
Joined
Sep 18, 2014
Messages
119
It already is inside the for next loop. Each time it goes round the loop it just adds the next attachment to the current email instead of starting a whole new email.

Edit - sorry I see what you mean - my bad will try it
 

Watch MrExcel Video

Forum statistics

Threads
1,108,969
Messages
5,525,960
Members
409,673
Latest member
Riseee

This Week's Hot Topics

Top