Send email without outlook security warning

Only applies to Office 2003. with 2007 you should not have this appear, assuming you have an antivirus program in place. With Office 2000-2002 the approach below does not work. Therefore, with Office 2000-2002 the only realistic way is to send mail is using SMTP (see CDO)

send email warning

This is part of the Outlook Security Model and cannot be disabled - unless you are an administrator: Customizing the Outlook Security Features Administrative Package - Office XP Resource Kit - Microsoft Office.

Fortunately since Outlook 2003 it is possibe to avoid the warning messages using VBA code to be put inside Outlook.

In Outlook 2003 or later, if a MAPI Mail Item object is created from within the VBA project (specifically the 'ThisOutlookSession' module), it is assumed to be "Trusted" and will not prompt the usual security messages when attempting to call the .Send method or when making use of the Outlook address book.  We will be using this "Trusted" method to create an exposed Outlook VBA function that creates and sends the MailItem and then call this using Automation from our application.  In our example, we will be calling the exposed Outlook VBA function from within Access. The exposed Outlook function we use from Mail Merge for Microsoft Access is called ammolSendMail.

Setting up the Outlook VBA code

  1. Open Outlook

  2. Go to the menu item Tools / Macro / Visual Basic Editor

  3. In the VB environment expand the project node (usually called 'Project1')

  4. Find and open the module 'ThisOutlookSession' (double click to open)

  5. Copy and paste the code from here: Add this code in module ThisOutlookSession

  6. Sign the Outlook VBA code with a digital certificate (optional)

  7. Trust all documents from this publisher

  8. Close Outlook and safe changes

From now on you will no longer be bothered by the outlook security warning when you send emails using 4TOPS Mail Merge.