rebelhunter
New Member
- Joined
- Oct 24, 2002
- Messages
- 11
hey guys and gals!!
Heres coding of a macro which emails multiple excel files to multiple recipients.
For the macro to work, insert files to send under column A and email groupings created in outlook under column B.:
Private Sub CommandButton1_Click()
Dim aOutlook As Outlook.Application, aEmail As Outlook.MailItem
CRLF = Chr(10) & Chr(13)
Application.ScreenUpdating = False
DATA = Sheets("sheet1").Range("A1:A15")
CROW = 1
Set aOutlook = GetObject(, "Outlook.Application")
DATA = Sheets("sheet1").Range("A1:A15")
CROW = 1
For Each MAILFILE In DATA
Set aEmail = aOutlook.CreateItem(olmailitem)
aEmail.Subject = "Daily " & MAILFILE & " for your perusal."
aEmail.Body = "Please find attached the " & MAILFILE & " for today." & CRLF & CRLF
aEmail.Recipients.Add Sheets("sheet1").Range("B" & CROW)
aEmail.ATTACHMENTS.Add ("j:misellaneousutrustpricingut mail attachments" & MAILFILE)
aEmail.Send
CROW = CROW + 1
Next MAILFILE
MsgBox "Emails successfully sent."
End Sub
Private Sub EMAIL_Click()
End Sub
Heres coding of a macro which emails multiple excel files to multiple recipients.
For the macro to work, insert files to send under column A and email groupings created in outlook under column B.:
Private Sub CommandButton1_Click()
Dim aOutlook As Outlook.Application, aEmail As Outlook.MailItem
CRLF = Chr(10) & Chr(13)
Application.ScreenUpdating = False
DATA = Sheets("sheet1").Range("A1:A15")
CROW = 1
Set aOutlook = GetObject(, "Outlook.Application")
DATA = Sheets("sheet1").Range("A1:A15")
CROW = 1
For Each MAILFILE In DATA
Set aEmail = aOutlook.CreateItem(olmailitem)
aEmail.Subject = "Daily " & MAILFILE & " for your perusal."
aEmail.Body = "Please find attached the " & MAILFILE & " for today." & CRLF & CRLF
aEmail.Recipients.Add Sheets("sheet1").Range("B" & CROW)
aEmail.ATTACHMENTS.Add ("j:misellaneousutrustpricingut mail attachments" & MAILFILE)
aEmail.Send
CROW = CROW + 1
Next MAILFILE
MsgBox "Emails successfully sent."
End Sub
Private Sub EMAIL_Click()
End Sub