Send Email to multiple .CC in outlook, from Excel userform

tripodgod

New Member
Joined
Dec 22, 2013
Messages
16
Hello again,

I have almost finished the project i am working on, but am stuck in trying to get 2 people in the CC column of the generated email. I have created an order number system, that has variable email addresses in TextBox11 and TextBox12. Here is my code:

Code:
Private Sub CommandButton4_Click()
Dim oOLook As Object
Dim oEMail As Object

Set oOLook = CreateObject("Outlook.Application")
oOLook.Session.Logon
Set oEMail = oOLook.CreateItem(0)
oEMail.Display

 On Error Resume Next
With oEMail
 .To = TextBox7.Text
 .CC = TextBox11.Text & TextBox12.Text
 .BCC = TextBox9.Text
 .Subject = "Order Number"
 .Body = "Good morning / afternoon"

 End With
 On Error GoTo 0

End Sub

This does what i want, except the 2 email addresses have no ";"... For example: joe@thismail.comjim@thismail.com.

I am sure it is a very simple thing i am missing here, but i haven't done much coding before.

Any help is appreciated!

Thank you
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
You should only need to add the semi-colon, as you suspected:

Code:
.CC = TextBox11.Text [B]& ";" & [/B]TextBox12.Text
 
Upvote 0

Forum statistics

Threads
1,223,268
Messages
6,171,099
Members
452,379
Latest member
IainTru

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