How can I get rid of dialog box?

E

Ed

I have a program in Access that checks the status of Outlook tasks. The
program works fine, but every time it runs the user get a dialog box saying
"A program is trying to access email address you have stored in Outlook. Do
you want to allow this?" This is very annoying to the user. How can I get
rid of this?

This is a piece of the code:

Dim myOlApp As New Outlook.Application
Dim olns As NameSpace
Dim TasksFolders As MAPIFolder
Dim taskItems As TaskItem
Dim Itm As TaskItem
Dim sMyName As String
Dim sTaskID As String

Set olns = myOlApp.GetNamespace("MAPI")
Set TasksFolders = olns.GetDefaultFolder(olFolderTasks)

For Each Itm In TasksFolders.Items
If Itm.Subject = sTaskID _
And Itm.Owner = sMyName Then
'Do something
end if
Next
 
S

Sue Mosher [MVP-Outlook]

See http://www.outlookcode.com/d/sec.htm for your options with regard to the
"object model guard" security in Outlook 2000 SP2 and later versions.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 

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