# Visual Basic > Visual Basic FAQs >  [FAQ's: OD] Why do I get an Outlook Security Prompt?

## RobDog888

Starting with Outlook 2000 Service Pack 3 Microsoft has added the infamous "Security Prompt" when a program is trying to access or automate certain areas/features of Outlook. This is to help protect you from attacks by virus'.

There are a couple of types of security prompts. One is just when your automating it notifies you that a program is attempting to access Outlook email addresses (Fig. 1). A second is when your attempting to access Outlook Data (Fig. 2). And lastly, a third is when you are programmatically trying to send an email and it makes you wait a few seconds before it enables the Yes/No buttons on the prompt. (Fig. 3)

Fig. 1



Fig. 2



Fig. 3






For the first two types you will need to check the "Allow access for" checkbox (Fig. 4) and then select a time duration to allow (Fig. 5).

Fig. 4



Fig. 5




Here is a chart on the property, functions, and methods that are protected by the Security Prompt:

Items marked with an asterisk (*) are new for Outlook 2003.



```
Object          |  Restricted Properties          |  Restricted Methods
-----------------------------------------------------------------------
Action          |                                 |  Execute

AddressEntries  |  Any property                   |  Any method

AddressEntry    |  Any property                   |  Any method

AppointmentItem |  Body*                          |  Respond
AppointmentItem |  Organizer                      |  SaveAs
AppointmentItem |  RequiredAttendees              |  Send
AppointmentItem |  OptionalAttendees              |
AppointmentItem |  Resources                      |
AppointmentItem |  NetMeetingOrganizerAlias       |

ContactItem     |  Body*                          |  SaveAs
ContactItem     |  Email1Address                  |
ContactItem     |  Email1AddressType              |
ContactItem     |  Email1DisplayName              |
ContactItem     |  Email1EntryID                  |
ContactItem     |  Email2Address                  |
ContactItem     |  Email2AddressType              |
ContactItem     |  Email2DisplayName              |
ContactItem     |  Email2EntryID                  |
ContactItem     |  Email3Address                  |
ContactItem     |  Email3AddressType              |
ContactItem     |  Email3DisplayName              |
ContactItem     |  Email3EntryID                  |
ContactItem     |  IMAddress*                     |
ContactItem     |  NetMeetingAlias                |
ContactItem     |  ReferredBy                     |

DistListItem    |  Body*                          |  GetMember
DistListItem    |                                 |  SaveAs

Inspector       |  HTMLEditor*                    |
Inspector       |  WordEditor*                    |

ItemProperties  |  Any restricted property        |

JournalItem     |  Body*                          |  SaveAs
JournalItem     |  Contactnames                   |

MailItem        |  Body*                          |  SaveAs
MailItem        |  HTLMBody*                      |  Send
MailItem        |  SenderEmailAddress*            |
MailItem        |  SenderEmailType*               |
MailItem        |  SenderName                     |
MailItem        |  SentOnBehalfOfName             |
MailItem        |  ReceivedByName                 |
MailItem        |  ReceivedOnBehalfOfName         |
MailItem        |  ReplyRecipientNames            |
MailItem        |  To                             |
MailItem        |  Cc                             |
MailItem        |  Bcc                            |

MeetingItem     |  Body*                          |  SaveAs
MeetingItem     |  SenderName                     |

Namespace       |  CurrentUser                    |
Namespace       |  GetRecipientFromID             |

PostItem        |  Body*                          |  SaveAs
PostItem        |  HTMLBody*                      |
PostItem        |  SenderName                     |

Recipient       |  Any property                   |  Any method

Recipients      |  Any property                   |  Any method

TaskItem        |  Body*                          |  SaveAs
TaskItem        |  ContactNames                   |  Send
TaskItem        |  Contacts                       |
TaskItem        |  Delegator                      |
TaskItem        |  Owner                          |
TaskItem        |  StatusUpdateRecipients         |
TaskItem        |  StatusOnCompletionRecipients   |

UserProperties  |                                 |  Find

UserProperty    |  Formula                        |
```


If your writting code in Outlooks VBA IDE then you can avoid the security prompt by using the default Application object and handling your code with that instance. As soon as you create a secondary New instance, or are automating Outlook from another language like VB 6, VB.NET or C#, you will invoke the security prompt.

To get around this, you could just make sure to use only the default VBA instance, create a Trusted Outlook COM Add-In, use a third-party utility or set your app as Trusted in the Exchange Administration Contro Panel (if your running Outlook in an Exchange environment).

----------


## jlbantang

hi rob the post was great! anyway, can you stress-out what do you mean of *add app as trusted in the exchange admin control panel* this might be the solution im looking at to remove outlook security prompt.

thnx.

----------


## dilettante

This appears to have been relaxed in Outlook 2007, though I can't test it since I don't have Outlook 2007 installed.  It requires Vista or XP with an anti-virus package in place.

Code Security Changes in Outlook 2007

----------


## chris128

> hi rob the post was great! anyway, can you stress-out what do you mean of *add app as trusted in the exchange admin control panel* this might be the solution im looking at to remove outlook security prompt.
> 
> thnx.


Im an Exchange administrator and I have never seen such a thing, the way I have got around this problem with third party apps in the past is to do the following:

Create a Public Folder in Exchange named "Outlook Security Settings". Must be at the top level of the Public Folder tree and make sure users have at least Read access. It is important that the name is exactly as I have written it (of course, without the quote marks) 
   Download the Outlook Security pack here:http://download.microsoft.com/downlo...54/admpack.exe
       Extract the files and you should then have an outlk9.adm file and an Outlook Default Settings.oft file.
   Open the OFT file and when asked where to import it to, choose the public folder you just created 
   Open the form in Outlook (you might already be at that screen from the last step) and go to the programmatic settings tab, change all of the settings to auto approve 
   Leave everything else in the form as it is, then click the Post button in the top left corner. 
   Copy the outlk9.adm file accross to your DC and then create a new Group Policy Object that affects all users (doesnt need to affect computers) 
   Edit the new policy and import the outlk9.adm file into the Administrative Templates section under the User Configuration section 
   Now, still in the User section of the GPO, drill down into the Admin Templates and then into the Outlook 2000/2003 folder then into the folder named Tools | Options and then into Security 
   There may only be one policy in here but just in case you have a few, the one you are looking for is named something like "Virus Settings". Open this policy up and enable it and choose the option from the drop down list that says "Search Outlook Security Settings folder for security settings"
   Go onto a users machine and do a gpupdate /force then test it out!

I've got this working in Exchange 5.5 and 2003 environments but I havent ever tested it in Exchange 2007. Hope that helps someone as I know I spent ages trying to get rid of this damn prompt!

----------

