Read outlook from MS ACCESS, how to disable "Do You want to allow this"

M

mik.sjoblom

Hello,
I have developed a Access application that needs to read mail from
Outlook, versions on Access and outlook are 2003. In the code i use
mapi to connect to outlook. When i tries to read the subject of a
message outlook displays "A program is trying to access e-mail
adresses you have stored in Outlook. Do you want to allow this."
And then i can allow access for max 10 minutes.
My application is use scheduled statupm creating reports without
man-macine interferance so i need to disable this message.

I have tried with modifiing registry
KEY_CURRENT_USER\Software\Microsoft\Office\10.0\Outlook\Security
(change 10.0 to 9.0 for Outlook 2000 SP3 or to 11.0 for Outlook 2003)
Under that key, add a new string value named Level1Remove. and added .

mdb
but this doesn't work.


I would prefer a solution where I can change the application or change
some registry settings, that only affects access applications. The last

resort would be to install a program that disconnects the security for
all types of programs.


Thanks Mikael Sjoeblom


Following are cut outs of the application.


Public Sub OutlookReadNewMail(intComputerGroup As Integer)
On Error GoTo Err_OutlookReadNewMail


Dim olApp As OutLook.Application
Dim Olmapi As OutLook.NameSpace
Dim Olfolder As OutLook.MAPIFolder
Dim olMail As Object 'Have to late bind as appointments e.t.c screw it
up
Dim OlItems As OutLook.Items
..
..
..


'Create a connection to outlook
Set olApp = CreateObject("Outlook.Application")
Set Olmapi = olApp.GetNamespace("MAPI")


..
..
..


Set OlItems = Olfolder.Items


'For each mail in the collection check the subject line and process
accordingly
For Each olMail In OlItems
If olMail.UnRead = True Then
olMail.Body ' This line activates trying
to access e-mail adressess
' Can't understand why
because it is the body
' not the e-mail adressess.


..
 

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