Turn off the Outlook send.item warning

rices

New Member
Joined
Aug 23, 2006
Messages
36
I trying to send email using VBA through the send.mail function.
How can I turn off the Outlook virus warning and turn it back on when I finish?
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
You can't. This "feature" was added to prevent viruses from accessing your addressbook and spreading the disease.

Another option is to send mail using an Outlook object, then Display the message rather than Sending it. This allows the user to see what the automatically generated message looks like, and gives them the option to Send or Cancel without generating the Virus message...
 
Upvote 0
An even simpler way is to use

Dim olApp As Object
Const olMailItem = 0 'Outlook intrinsic constants not available e-mail = 0
Const olImportanceNormal = 1 'Outlook intrinsic constants not available
Const olImportanceHigh = 2 'Outlook intrinsic constants not available
'Create an Outlook message and set its HTMLBody property to what we created above
Set olApp = CreateObject("Outlook.Application")
Set olMail = olApp.CreateItem(olMailItem)
With olMail
'You can set all sorts of properties of your email e.g.
.Subject = "Your order has come in."
.Body = Whatever the body is (as string)
.To = Address (as string)
.Importance = olImportanceHigh
.Display
End With

'Wait for System to catch up and send
Application.Wait (Now + TimeValue("0:00:01"))
Application.SendKeys "%s"
Application.Wait (Now + TimeValue("0:00:01"))

This was sent to me by another poster on this board, but I'm too lazy to go and find it...easier to just paste the code they gave me
 
Upvote 0

Forum statistics

Threads
1,214,943
Messages
6,122,370
Members
449,080
Latest member
Armadillos

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top