PDA

View Full Version : Outlook Security Warning - Email



Philcjr
03-31-2010, 07:51 AM
I have searched and read many websites already and I am just not clear if it is possible to turn off the "annoying" security warning message from Outlook.

All I want to do is send a simple e-mail with a message.

From this code, can anyone help?


Sub EMail_Test()

Dim OutApp As Object, OutMail As Object

Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)

On Error Resume Next
With OutMail
.To = "Philip.Collins@pfizer.com"
.Subject = "The US20 SKU File has been updated"
.Body = "Completed File Scrub"
.Display
End With
On Error GoTo 0

Set OutMail = Nothing
Set OutApp = Nothing

End Sub

lucas
03-31-2010, 12:40 PM
Have you tried this? (http://www.vbaexpress.com/forum/showthread.php?t=16364)

Philcjr
03-31-2010, 03:04 PM
Lucas,

Thanks for moving this to the Outlook section... I was not sure if this was and Excel or Outlook issue.

I have not tried this link, when I get back into work in the AM, I will try and post back my results.

Philcjr
04-02-2010, 12:16 PM
Lucas,

While surfing around on "Ron de Bruin" site: http://www.rondebruin.nl/mail/prevent.htm

I found this, using the "Send Keys" (commented lines)... however, when the e-mail is created, the window loses its focus... any idea how to activate/set focus to the new e-mail window?


On Error Resume Next
With OutMail
.To = "Philip.Collins@.com"
.Subject = "Completed File Scrub"
.Body = UserName & " has completed the US20 SKU File scrub"
.Display
'Application.Wait (Now + TimeValue("0:00:02"))
'Application.SendKeys "%s"
End With
On Error GoTo 0