hi there,
I have this basic vba code and it works great. However, I'm trying to add so the current user automatically gets cc'd to the email, but I am really struggling. Can someone please help? THANKS in advance!
Sub Button1_Click()
Dim OutApp As Object
Dim OutMail As Object
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
With OutMail
.To = "technicalsupport@cnrl.com"
.CC = .Me!CC
.BCC = ""
.Subject = "Ad Hoc Report Request"
.Body = "Request form attached."
.Attachments.Add ActiveWorkbook.FullName
.Send
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
I have this basic vba code and it works great. However, I'm trying to add so the current user automatically gets cc'd to the email, but I am really struggling. Can someone please help? THANKS in advance!
Sub Button1_Click()
Dim OutApp As Object
Dim OutMail As Object
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
With OutMail
.To = "technicalsupport@cnrl.com"
.CC = .Me!CC
.BCC = ""
.Subject = "Ad Hoc Report Request"
.Body = "Request form attached."
.Attachments.Add ActiveWorkbook.FullName
.Send
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
End Sub