I am trying to automate a report so that a it is sent to a mail list automatically every morning. Here is the relevant section of code:
Set OlkApp = CreateObject("Outlook.Application"
Set NewMail = OlkApp.CreateItem(olMailItem)
Set Attachments = NewMail.Attachments
message = "some text"
mail_list = Range("Mail_List".Text
With NewMail
.To = mail_list
.Body = message
.Importance = 1
.Attachments.Add strPath, 1, 2
.Subject = strFileName
.Send
End With
This works fine, except that when it gets to ".send" I get a dialog box from Outlook, telling me that an application is trying to send mail on my behalf and asking me if this is alright. Is there any way to turn off this feature, or possibly some code which will allow me to tell it it's ok without my manual intervention?
Thanks...
Set OlkApp = CreateObject("Outlook.Application"
Set NewMail = OlkApp.CreateItem(olMailItem)
Set Attachments = NewMail.Attachments
message = "some text"
mail_list = Range("Mail_List".Text
With NewMail
.To = mail_list
.Body = message
.Importance = 1
.Attachments.Add strPath, 1, 2
.Subject = strFileName
.Send
End With
This works fine, except that when it gets to ".send" I get a dialog box from Outlook, telling me that an application is trying to send mail on my behalf and asking me if this is alright. Is there any way to turn off this feature, or possibly some code which will allow me to tell it it's ok without my manual intervention?
Thanks...