Error 429 on creation of MAPI Session

J

jm.almeras

Dear Outlook and VB experts,

In an Access database I have code which searches messages in the Outlook
Inbox folder. This code has worked fine for some time, and some time ago it
started not working any more. It produces a 429 error on the instruction
n°2 here below :

Set objOutlook = CreateObject("Outlook.Application")
Set objSession = CreateObject("MAPI.Session")

The error message says "An ActiveX component cannot create an object"
(translation from the original French message)

The computer is used by a small number of persons, I do not control
everything that other users do, but apparently there has been no significant
change (software updates, ...) which could explain this sudden malfunction.

We have the same database installed on another computer and it works fine
there, but under Access 2003 / Outlook 2003 whereas on the computer where
the error occurs we have Access 2002 / Outlook 2002

The code was adapted from code found on the Internet. I am no expert on
Outlook programming, I do not even know what a Mapi session is. I searched
the web for similar errors and found many articles speaking of "CDO". I
found advice to register a CDO dll but the system did not find this dll.

If you have any idea where the problem could be I will be very grateful if
you let me know

Jean-Marie
 
B

Bruno Campanini

jm.almeras laid this down on his screen :
Dear Outlook and VB experts,

In an Access database I have code which searches messages in the Outlook
Inbox folder. This code has worked fine for some time, and some time ago it
started not working any more. It produces a 429 error on the instruction n°2
here below :

Set objOutlook = CreateObject("Outlook.Application")
Set objSession = CreateObject("MAPI.Session")

Try using this sytax:
Dim Mail As Outlook.Folder
Set Mail = Session.GetDefaultFolder(olFolderSentMail)

Dim MailReceived As Outlook.Folder
Set MailReceived = Session.Folders("(e-mail address removed)").Folders("Inbox")

Dim Kontact As Outlook.Items
Set Kontact = Session.GetDefaultFolder(olFolderContacts).Items

Dim Kalendar As Outlook.Items
Set Kalendar = Session.GetDefaultFolder(olFolderCalendar).Items

etc.

Bruno
 

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