Hi all,
I've been following along with Ron deBruin's tutorial for setting up an Outlook launcher on mac that emails out a copy of the excel file being worked on, but I keep hitting a wall when I try to adapt the CC: line to include multiple emails. Ron's instructions say simply to list them with commas, but when I do that I get a single block line emailA@A.com,emailB@B.com,emailC@C.com and the email errs when I attempt to send.
Spaces, semi colons, and enclosing the emails as "emailA@A.com", & "emailB@B.com" don't work.
Nor does emailA@A.com", & ",emailB@B.com"
Here's the code I'm using:
Sub Mail_Workbook_Excel2011_1()
'For Excel 2011 for the Mac and Apple Mail
'mails the UserReq on Mac
Dim wb As Workbook
Dim TempFilePath As String
Dim TempFileName As String
Dim FileExtStr As String
If Val(Application.Version) < 14 Then Exit Sub
Set wb = ActiveWorkbook
With Application
.ScreenUpdating = False
.EnableEvents = False
End With
''Save the new workbook and mail it.
'If you want to change the file name then change only TempFileName
TempFilePath = MacScript("return (path to documents folder) as string")
TempFileName = "Request_" & Range("F21") & "_" & Format(Now, "dd-mmm-yy")
FileExtStr = ".xlsm"
With wb
.SaveCopyAs TempFilePath & TempFileName & FileExtStr
MailFromMacwithOutlook bodycontent:=Range("S2"), _
mailsubject:=Range("S1"), _
toaddress:="Service.Desk@service.com", _
ccaddress:="emailA@A.com,emailB@B.com,emailC@C.com", _
bccaddress:=Range("G12"), _
attachment:=TempFilePath & TempFileName & FileExtStr, _
displaymail:=True
End With
Set wb = Nothing
With Application
.ScreenUpdating = True
.EnableEvents = True
End With
End Sub
Thoughts?
Bookmarks