jboyerGAIC
Programmer
Is there a way to seperate attachments in an email? I have created a macro that will send 4 reports to a user, but I would like to put each attachment on a seperate line. Any ideas?
Here is basically what I have:
Sub Main()
Dim olapp As Object
Dim oitem As Object
Dim objEmail As Object
Set olapp = CreateObject("Outlook.Application")
Set oitem = olapp.CreateItem(0)
With oitem
.Subject = "Report subject"
.To = "<user@company.com>"
.Body = "Please look at the attached Report(s):"
.Attachments.Add ("\\path\file1.pdf")
.Attachments.Add ("\\path\file2.pdf")
.Attachments.Add ("\\path\file3.pdf")
.Attachments.Add ("\\path\file4.pdf")
.Send
End With
Set olapp = Nothing
Set oitem = Nothing
End Sub
Also, Is there a way to specify who the email is from? This code currently defaults me as the sender.
Thanks!
-Jamie
Here is basically what I have:
Sub Main()
Dim olapp As Object
Dim oitem As Object
Dim objEmail As Object
Set olapp = CreateObject("Outlook.Application")
Set oitem = olapp.CreateItem(0)
With oitem
.Subject = "Report subject"
.To = "<user@company.com>"
.Body = "Please look at the attached Report(s):"
.Attachments.Add ("\\path\file1.pdf")
.Attachments.Add ("\\path\file2.pdf")
.Attachments.Add ("\\path\file3.pdf")
.Attachments.Add ("\\path\file4.pdf")
.Send
End With
Set olapp = Nothing
Set oitem = Nothing
End Sub
Also, Is there a way to specify who the email is from? This code currently defaults me as the sender.
Thanks!
-Jamie