J
Jason Morin
Hello, using Outlook 2003. I use some basic VBA code (see
below) in Microsoft Excel that sends an email with an
attachment. However, each time I run the macro from
Excel, Outlook gives me the message:
"A program is trying to automatically send an e-mail on
your behalf. Do you want to allow this?"
Rather than pressing "yes" each time, is there any way to
suppress this message in Outlook and let the email fly?
Thanks.
Jason
////////////////////////////////
Sub Mail_File()
'Ron de Bruin
Dim OutApp As Outlook.Application
Dim OutMail As Outlook.MailItem
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(olMailItem)
With OutMail
.To = "[email protected]"
.CC = ""
.BCC = ""
.Subject = "IE Favorites"
.Body = ""
.Attachments.Add ("S:\blahblah")
.Send
End With
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
below) in Microsoft Excel that sends an email with an
attachment. However, each time I run the macro from
Excel, Outlook gives me the message:
"A program is trying to automatically send an e-mail on
your behalf. Do you want to allow this?"
Rather than pressing "yes" each time, is there any way to
suppress this message in Outlook and let the email fly?
Thanks.
Jason
////////////////////////////////
Sub Mail_File()
'Ron de Bruin
Dim OutApp As Outlook.Application
Dim OutMail As Outlook.MailItem
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(olMailItem)
With OutMail
.To = "[email protected]"
.CC = ""
.BCC = ""
.Subject = "IE Favorites"
.Body = ""
.Attachments.Add ("S:\blahblah")
.Send
End With
Set OutMail = Nothing
Set OutApp = Nothing
End Sub