Disable Outlook object model security guard

Security Manager
for Microsoft® Outlook®

What Outlook versions have the Object Model Guard?

The Outlook 2000 E-mail Security Update has added to Outlook one more security issue which was later called the Outlook Object Model Guard. Starting from Outlook 2000 Service Pack 2 that included this Outlook Email Security Update, all versions of Microsoft Outlook trigger security prompts and block access to Outlook objects in an effort to prevent malicious programs from retrieving email addresses from Outlook data and using Outlook to propagate viruses and spam.

You will get the security warning if you access protected Outlook objects from inside of your standalone applications that automate Outlook 2000 - 2021.

If you develop Outlook add-ins, you will get the security alert only in Outlook 2000. Any later versions of Outlook support the Trusted Add-ins technology that allows you to bypass the object model guard.

Outlook security guard triggers the following dialog boxes:

A program is trying to access e-mail addresses you have stored in Outlook


A program is trying to access e-mail addresses you have stored in Outlook

A program is trying to automatically send e-mail on your behalf


 program is trying to automatically send e-mail on your behalf

What Outlook objects are protected by the Outlook E-mail Security Update

In terms of the Outlook Security Manager all blocked Outlook objects are called protected objects. The Outlook object model security guard protects the Outlook objects described below.

The Outlook.Item object

The Outlook object model guard prevents accessing the following issues of the Outlook.Item object:

  • The Attachments collection. Unsafe attachments are not accessible in the Outlook object model. The Attachments collection in the object model is unaware of unsafe attachments.
  • The Send method. When you run a program that uses the Outlook object model to call the Send method, you receive a warning message.
  • The SaveAs method. When you use the SaveAs method to save items to the file system, you receive an "address book" warning message.

Address Books, Recipients and Outlook Items

Outlook Email Security Update protects Outlook Address Books, the Recipients collection and Outlook items objects, namely:

  • The AddressEntries collection or any AddressEntry object.
  • The Recipients collection or any Recipient object.
  • The following properties of a ContactItem object: Email1.Address, Email1.AddressType, Email1.DisplayName, Email1.EntryID, Email2.Address, Email2.AddressType, Email2.DisplayName, Email2.EntryID, Email3.Address, Email3.AddressType, Email3.DisplayName, Email3.EntryID, NetMeetingAlias, ReferredBy .
  • The following properties of a MailItem object: SentOnBehalfOfName, SenderName, ReceivedByName, ReceivedOnBehalfOfName, ReplyRecipientNames, To, Cc, Bcc.
  • The following properties of an AppointmentItem object: Organizer, RequiredAttendees, OptionalAttendees, Resources, NetMeetingOrganizerAlias.
  • The following properties of a TaskItem object: ContactNames, Contacts, Delegator, Owner, StatusUpdateRecipients, StatusOnCompletionRecipients.
  • The GetMember method of a DistListItem object.
  • The ContactNames property of a JournalItem object.
  • The SenderName property of a MeetingItem object.
  • The SenderName property of a PostItem object.
  • The GetRecipientFromID property of a Namespace object.
  • The Execute method of an Action object.
  • The Formula property of a UserProperty object.

What Outlook Security Manager provides to bypass the Outlook Object Model Guard

Outlook Security Manager provides a special property, DisableOOMWarnings, that disables all Outlook security warnings triggered by the object model guard on accessing protected objects. For example:

Visual Basic .NET

Imports Outlook = Microsoft.Office.Interop.Outlook
'...
Dim SecurityManager As New AddinExpress.Outlook.SecurityManager
Dim OutlookApp As New Outlook._Application
Dim OutlookItem As Outlook.MailItem
'...
' Connects to an Outlook instance
SecurityManager.ConnectTo(OutlookApp)
' Getting the first item in the Inbox folder
OutlookItem = OutlookApp.GetNameSpace("MAPI").GetDefaultFolder(olFolderInbox).Items(1)
' Disables security warnings on accessing the objects
' protected by Outlook Object Model Guard
SecurityManager.DisableOOMWarnings = True
Try
' The SenderName is a protected property of the MailItem object
MsgBox (OutlookItem.SenderName)
Finally
' In any case, please remember to turn on Outlook security warnings
' after your code, since now it is very easy to switch it off!
SecurityManager.DisableOOMWarnings = False
End Try

The code example above is in Visual Basic .NET, but the Outlook Security Manager supports all .NET programming languages, including VB.NET, C#, C++, J#, Delphi for .NET, RemObjects Chrome as well as Delphi for Win32, Visual Basic 6, Visual C++ 6, Visual Basic for Applications including Access VBA, Excel VBA, VBScript, JScript, etc.