How to avoid secure warning dialog box?(Some ex. in MSDN Doesn't w

G

Guest

I'm programming a COM Add-in for outlook2003. UnFortunately, the warning
dialog box always popes up what I tries to save a sent mail item
programmally.like this:

'**********************************************
Dim olApp As Outlook.Application
Dim objMailItem As Outlook.MailItem
Set olApp = Application
Set objMailItem = olApp.Session.GetDefaultFolder(olFolderSentMail).Items(1)
Call SaveMailItemAsFile(objMailItem, sFullPath)
'***********************************************

So I researched MSDN and found an example of article "What's New in
Microsoft Office Outlook 2003 for Developers?", which said that would avoid
secure warning dialog box:

Sub TrustedCode()
Dim olApp As Outlook.Application
Set olApp = Application
Dim oMail As Outlook.MailItem
Set oMail = _
olApp.Session.GetDefaultFolder(olFolderInbox).Items(1)
MsgBox oMail.SenderEmailAddress, vbInformation
End Sub

But it doesn't work, in fact. How could I do?Somebody helps me.
 
S

Sue Mosher [MVP-Outlook]

All your objects need to derive from the Application object passed by the OnConnection event. Also, if you are connection to Exchange and have the CheckAdminSettings registry value set to anything other than 0, then Exchange administrator will need to set up a security settings item that trusts your add-in. See http://www.outlookcode.com/d/sec.htm
 

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