C
CAM
Below is my code for sending an email that poplulates the email address,
subject and description and attaches a pdf file via command button and it
works great, but I want to send two pdf or excel attachements at the same
time. How do I do that? any tips will be appreciated. Thank you in
advance.
Cheers
Private Sub eMail_Click()
On Error GoTo Err_eMail_Click
Dim sFile As String
Dim email As String
Dim ref As String
Dim PeriodFrom As String
Dim PeriodEnded As String
Dim Receiver As String
Dim When As String
Dim Who As String
Dim Bywhen As String
Dim Importance As String
Dim Reporter As String
Dim objOutlook As Outlook.Application
Dim objEmail As Outlook.MailItem
email = txteMailRecipient
ref = "eBill from Corporate Services USA"
PeriodFrom = txtPeriodFrom
PeriodEnded = txtPeriodEnded
Set objOutlook = CreateObject("Outlook.application")
Set objEmail = objOutlook.CreateItem(olMailItem)
With objEmail
..To = email
..Subject = ref & " "
..Body = "Attached is your Bill for Product and Services from " &
txtPeriodFrom & " to " & txtPeriodEnded & " . If you need further
assistance, please call us @ (888) 888-8888. Thank you." & vbCr & vbCr &
"Sincerely," & vbCr & vbCr & "Corporate Services Department" & vbCr & "" &
vbCr & ""
..Display
..Attachments.Add ("C:\ Data\Electronic Bills\ACME\2009\Current PDF\Billing
Summary.pdf")
End With
Exit_eMail_Click:
Exit Sub
Err_eMail_Click:
MsgBox Err.Description
Resume Exit_eMail_Click
End Sub
subject and description and attaches a pdf file via command button and it
works great, but I want to send two pdf or excel attachements at the same
time. How do I do that? any tips will be appreciated. Thank you in
advance.
Cheers
Private Sub eMail_Click()
On Error GoTo Err_eMail_Click
Dim sFile As String
Dim email As String
Dim ref As String
Dim PeriodFrom As String
Dim PeriodEnded As String
Dim Receiver As String
Dim When As String
Dim Who As String
Dim Bywhen As String
Dim Importance As String
Dim Reporter As String
Dim objOutlook As Outlook.Application
Dim objEmail As Outlook.MailItem
email = txteMailRecipient
ref = "eBill from Corporate Services USA"
PeriodFrom = txtPeriodFrom
PeriodEnded = txtPeriodEnded
Set objOutlook = CreateObject("Outlook.application")
Set objEmail = objOutlook.CreateItem(olMailItem)
With objEmail
..To = email
..Subject = ref & " "
..Body = "Attached is your Bill for Product and Services from " &
txtPeriodFrom & " to " & txtPeriodEnded & " . If you need further
assistance, please call us @ (888) 888-8888. Thank you." & vbCr & vbCr &
"Sincerely," & vbCr & vbCr & "Corporate Services Department" & vbCr & "" &
vbCr & ""
..Display
..Attachments.Add ("C:\ Data\Electronic Bills\ACME\2009\Current PDF\Billing
Summary.pdf")
End With
Exit_eMail_Click:
Exit Sub
Err_eMail_Click:
MsgBox Err.Description
Resume Exit_eMail_Click
End Sub