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 :)
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
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
 
Upvote 0

Forum statistics

Threads
1,214,323
Messages
6,118,890
Members
448,854
Latest member
Eduard_Stoo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top