M
mrbalaje
I just found the following code to automatically add the attachement and send
to a receipient. It works fine. But What I want is that one email address
should be in the "To" field and 3 other email address to be in the "Bcc"
field.
Also in the body of the mail, I need to add two constant line(Text) and with
my signature. Can someone enhance the below coding for this requirement.
Sub Foobar()
Dim oApp As Outlook.Application
Dim oNS As Outlook.NameSpace
Dim oMail As Outlook.MailItem
Set oApp = CreateObject("Outlook.Application")
Set oNS = oApp.GetNameSpace("MAPI")
oNS.Logon
Set oMail = oApp.CreateItem(olMailItem)
With oMail
.Subject = "Cims data"
.Body = "Some body text"
.Attachments.Add "c:\myFolder\File1.xls"
.Attachments.Add "c:\myFolder\File2.xls"
.Recipients.Add "(e-mail address removed)"
.Recipients.ResolveAll
.Send
End With
End Sub
to a receipient. It works fine. But What I want is that one email address
should be in the "To" field and 3 other email address to be in the "Bcc"
field.
Also in the body of the mail, I need to add two constant line(Text) and with
my signature. Can someone enhance the below coding for this requirement.
Sub Foobar()
Dim oApp As Outlook.Application
Dim oNS As Outlook.NameSpace
Dim oMail As Outlook.MailItem
Set oApp = CreateObject("Outlook.Application")
Set oNS = oApp.GetNameSpace("MAPI")
oNS.Logon
Set oMail = oApp.CreateItem(olMailItem)
With oMail
.Subject = "Cims data"
.Body = "Some body text"
.Attachments.Add "c:\myFolder\File1.xls"
.Attachments.Add "c:\myFolder\File2.xls"
.Recipients.Add "(e-mail address removed)"
.Recipients.ResolveAll
.Send
End With
End Sub