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
******************************************************************************
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
******************************************************************************