How can I get rid of dialog box?

  • Thread starter Thread starter Ed
  • Start date Start date
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
 
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
 
Back
Top