CDO Access hangs outlook

H

Hoppers

I have been using the below code to access information via CDO. All
works fine on my outlook and many other users, however there are some
users that when they open my form their Outlook hangs.

A seperate Outlook process appears in task manager and it doesn't
matter how long i leave it the code never continues.
If the process is killed the CDO access returns a VBSript error.

"Error in lonon: - 2147024891
Collaberation Data Objects - E_Accessdenied(80070005)"

Can anyone help with any suggestions.

I'm not a developer and i'm quiet new to outlook coding so i would be
grateful for simplistic answers.

Thanks

Outlook version = 2002 sp2
Exchange 5.5

******************************************************************************
Function OpenMapiSession()
on error resume next
'Start the CDO code to find a match.
Set cdoSession = CreateObject("Mapi.session")
cdoSession.Logon ,,false,false,0 'Use the existing Outlook session.
if err.number <> 0 then msgbox "ERROR in logon: " & err.number &
vbCRLF & err.description
Set cdoAddrEntry = cdoSession.CurrentUser
if err.number <> 0 then msgbox "ERROR in logon: " & err.number &
vbCRLF & err.description
'Get data from Session.CurrentUser.
MapiSession = 1
PresentUser = cdoAddrEntry.fields(cdo_FirstName) & " " &
cdoAddrEntry.fields(cdo_Surname)
UserTelNumber = cdoAddrEntry.fields(cdoPR_Business_Telephone_Number)
RequestersDisplayName = cdoAddrEntry.fields(CdoPR_DISPLAY_NAME)
Item.UserProperties.find("ImplementerName").value = PresentUser
End Function
******************************************************************************
 
S

Sue Mosher [MVP-Outlook]

Have you checked to see whether CDO is indeed installed on these machines?
 
R

rg

Hello,

Two Outlook 2003 users at my company are having the same problem.

My code is similar (if not exactly the same--it is from a book example).

Set oCDOSession = application.CreateObject("MAPI.Session")

oCDOSession.Logon "", "", False, False, 0

http://support.microsoft.com/?kbid=177630 sounded like it might be the
problem, but

changing the Logon to

oCDOSession.Logon "", "", False, False, 0, True

did not fix the problem (although it still works on my computer).

I did check to make sure that the CDO component of Outlook 2003 was
installed (via the MS Office 2003 Install).

I have the appcompat.txt that MS created because of the error.

Any help is greatly appreciated. I haven't found any other possible
solutions by Googling yet.

Thank you,

Roy

Hoppers said:
I have been using the below code to access information via CDO. All
works fine on my outlook and many other users, however there are some
users that when they open my form their Outlook hangs.

A seperate Outlook process appears in task manager and it doesn't
matter how long i leave it the code never continues.
If the process is killed the CDO access returns a VBSript error.

"Error in lonon: - 2147024891
Collaberation Data Objects - E_Accessdenied(80070005)"

Can anyone help with any suggestions.

I'm not a developer and i'm quiet new to outlook coding so i would be
grateful for simplistic answers.

Thanks

Outlook version = 2002 sp2
Exchange 5.5

****************************************************************************
**
Function OpenMapiSession()
on error resume next
'Start the CDO code to find a match.
Set cdoSession = CreateObject("Mapi.session")
cdoSession.Logon ,,false,false,0 'Use the existing Outlook session.
if err.number <> 0 then msgbox "ERROR in logon: " & err.number &
vbCRLF & err.description
Set cdoAddrEntry = cdoSession.CurrentUser
if err.number <> 0 then msgbox "ERROR in logon: " & err.number &
vbCRLF & err.description
'Get data from Session.CurrentUser.
MapiSession = 1
PresentUser = cdoAddrEntry.fields(cdo_FirstName) & " " &
cdoAddrEntry.fields(cdo_Surname)
UserTelNumber = cdoAddrEntry.fields(cdoPR_Business_Telephone_Number)
RequestersDisplayName = cdoAddrEntry.fields(CdoPR_DISPLAY_NAME)
Item.UserProperties.find("ImplementerName").value = PresentUser
End Function
****************************************************************************
**
 

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