This is one way to pass data from the userform.
Option Explicit
Public objMsg As mailitem ' <----
Public Sub CreateNewMessage()
Dim strCustomer As String
Set objMsg = CreateObject("Outlook.Application").CreateItem(0)
With objMsg
UserForm1.Show
.To = "[mail1]"
.body = "xxx"
.Subject = "yyy"
Unload UserForm1
.Display
End With
Set objMsg = Nothing
End Sub
Private Sub cmdOK_Click()
If optCustomer01.Value = True Then
strCustomer = "[mail2]"
End If
If optCustomer02.Value = True Then
strCustomer = "[mail3]"
End If
objMsg.CC = strCustomer
UserForm1.Hide
End Sub
This is a second way.
Option Explicit
Public Sub CreateNewMessage()
Dim strCustomer As String
With CreateObject("Outlook.Application").CreateItem(0)
.Display ' <---
UserForm1.Show
.To = "[mail1]"
.body = "xxx"
.Subject = "yyy"
Unload UserForm1
End With
End Sub
Private Sub cmdOK_Click()
Dim strCustomer As String
Dim curritem As mailitem
Set curritem = ActiveInspector.currentItem
If optCustomer01.Value = True Then
strCustomer = "[mail2]"
End If
If optCustomer02.Value = True Then
strCustomer = "[mail3]"
End If
curritem.CC = strCustomer
Set curritem = Nothing
UserForm1.Hide
End Sub