Hi
I am using this code(below) to send a current unsaved workbook to a mail recipient when a button is clicked. I want to be able to add a cc/bcc email address, how do I do it? There are plenty of solution that send the saved form from a drive but I don't want users to be able to save the form. I have thought of saving it, sending then clearing resetting the form and resaving but that is cumbersome plus it may be on a sharepoint where they cannot save in any event. Also thought of saving as temporary file but sometimes getting a '400' error. I'm guessing there is a simple line or 2 that I am missing from this code. Many thanks
Sub Email_Open_WB_as_Attachment()
Dim myFile As String
Dim myMsg As String
Dim myEmail As String 'MsgBox ActiveWorkbook.Name
myFile = ActiveWorkbook.Name
myMsg = "form"
myEmail = "email@address.com"
Application.Workbooks(myFile).SendMail myEmail, myMsg, False
End Sub
I am using this code(below) to send a current unsaved workbook to a mail recipient when a button is clicked. I want to be able to add a cc/bcc email address, how do I do it? There are plenty of solution that send the saved form from a drive but I don't want users to be able to save the form. I have thought of saving it, sending then clearing resetting the form and resaving but that is cumbersome plus it may be on a sharepoint where they cannot save in any event. Also thought of saving as temporary file but sometimes getting a '400' error. I'm guessing there is a simple line or 2 that I am missing from this code. Many thanks
Sub Email_Open_WB_as_Attachment()
Dim myFile As String
Dim myMsg As String
Dim myEmail As String 'MsgBox ActiveWorkbook.Name
myFile = ActiveWorkbook.Name
myMsg = "form"
myEmail = "email@address.com"
Application.Workbooks(myFile).SendMail myEmail, myMsg, False
End Sub