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.
Code: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).





Reply With Quote