Setting Security Features of Outlook (IsTrusted)

D

Don

Does anyone know how to manage security settings of Outlook to allow code in
MS Access to use objects in Outlook?

We are using Office 2007 in a corporate environment. Trust Center in
Outlook appears to be set to allow programmatic execution from an
application outside of Outlook. The radio button is set to warn if the
anti-virus is out of date or invalid. (The selection is greyed out since as
a regular user I am not allowed to change it.) And it says the AV is valid
(Symantec Corporate edition)

However, when I execute the code, objRecip.Application.IsTrusted is set to
FALSE -- this is troubling since the trust center implies that the code
should execute. The way I read the manual
(http://msdn.microsoft.com/en-us/library/bb207708.aspx) Outlook will not
trust the object and presumably therefore not allow it to be set.

How can I go about making my MS Access VBA code trusted in Outlook? I
realize the security features in Outlook are there to prevent malcontents
from using viruses to grab Outlook. But there has to be a way for
legitimate users to call Outlook from Access (or Word, etc).

Suggestions? Thoughts?

Thanks!

Don




Here is the code sample:

Public Sub ProblemDemo2()
Dim oNS As Outlook.NameSpace
Dim objRecip As Outlook.Recipient
Dim objDist As Outlook.DistListItem
Dim RecipTrust As Boolean

' Trust Center in Outlook
' Appears to be set to allow programmtic access from other applications.
' Anti-virus: Valid
' Set to warn when AV is out of date or invalid
'
' Must create connection to Outlook as this code is in MS Access
Set olApp = New Outlook.Application
Set oNS = olApp.GetNamespace("MAPI")

Set objRecip = oNS.CreateRecipient("(e-mail address removed)")
' If I look at objRecip in Locals window, it appears to be
' showing default values. Address is <> as is AddressEntry
' objRecip.Application.IsTrusted is set to FALSE and is a
' READONLY property.
'
RecipTrust = objRecip.Application.IsTrusted

Set objDist = olApp.CreateItem(olDistributionListItem)
objDist.DLName = "VBATest_2"
objDist.Body = "Programmtic List Build Test"

objDist.AddMember objRecip

objDist.Save
objDist.Display
End Sub
 
K

Ken Slovak - [MVP - Outlook]

What are the settings on the Macro Security tab? On the Add-ins tab is the
checkbox for Apply macro security settings to installed add-ins checked?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top