Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi,
I am using the macro below to send e-mails out to customers. Sub Mail_workbook_Outlook() Dim OutApp As Object Dim OutMail As Object Dim cell As Range Dim strto As String For Each cell In ThisWorkbook.Sheets("Sheet1") _ .Columns("a").Cells.SpecialCells(xlCellTypeConstan ts) If cell.Value Like "*@*" Then strto = strto & cell.Value & ";" End If Next strto = Left(strto, Len(strto) - 1) Set OutApp = CreateObject("Outlook.Application") Set OutMail = OutApp.CreateItem(0) With OutMail .To = "" .CC = "" .BCC = strto .Subject = "This is the Subject line" .Body = "Hi there" .Attachments.Add ("") .Send 'or use .Display End With Set OutMail = Nothing Set OutApp = Nothing End Sub (I know that there isn't a command in there to quit outlook). Anyway, I know how to attach one document, but is there a way using this macro that I can send a message with multiple attachments? If so, can someone please tell me how? THANKS! |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Repeat this line
..Attachments.Add -- Regards Ron de Bruin http://www.rondebruin.nl "G and (ajk)" wrote in message ... Hi, I am using the macro below to send e-mails out to customers. Sub Mail_workbook_Outlook() Dim OutApp As Object Dim OutMail As Object Dim cell As Range Dim strto As String For Each cell In ThisWorkbook.Sheets("Sheet1") _ .Columns("a").Cells.SpecialCells(xlCellTypeConstan ts) If cell.Value Like "*@*" Then strto = strto & cell.Value & ";" End If Next strto = Left(strto, Len(strto) - 1) Set OutApp = CreateObject("Outlook.Application") Set OutMail = OutApp.CreateItem(0) With OutMail .To = "" .CC = "" .BCC = strto .Subject = "This is the Subject line" .Body = "Hi there" .Attachments.Add ("") .Send 'or use .Display End With Set OutMail = Nothing Set OutApp = Nothing End Sub (I know that there isn't a command in there to quit outlook). Anyway, I know how to attach one document, but is there a way using this macro that I can send a message with multiple attachments? If so, can someone please tell me how? THANKS! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how do I email amacro? | Excel Worksheet Functions | |||
Macro that will add data from multiple workbooks to the 1st open r | Excel Discussion (Misc queries) | |||
CREATE MACRO TO COPY MULTIPLE WORKSHEETS | Excel Discussion (Misc queries) | |||
How do I record a macro which should work on multiple files ? | Excel Discussion (Misc queries) | |||
Macro for multiple charts | Excel Worksheet Functions |