Error 424 Object Required

K

Karen

Dear All,

I got 2 error messages when a custom outlook form is run. I want to get the
loginID of the user and the name of his manager.
I believe that the errors are in the following code.
The error messages are "Error in logon: 424 object required" and "Error
getting AddressEntry: 424 Object required"
How to solve this problem? Thanks!


Set objNameSpace = Application.GetNameSpace("MAPI")
Set objCurrentUser = objNameSpace.CurrentUser
Set objAddressEntry = objCurrentUser.AddressEntry
Set strManager = objAddressEntry.Manager

'Assign alias

'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
End If

'Get the AddressEntry of the recipient/current user.
Set cdoAddrEntry = cdoSession.CurrentUser
If err.number <> 0 Then
MsgBox "ERROR getting AddressEntry: " & err.number & vbCRLF &
err.description
End If

'Get properties.
strAlias = cdoAddrEntry.fields(cdoPR_Account)
cdoSession.logoff

Set cdoAddrEntry = Nothing
Set cdoSession = Nothing
 
S

Sue Mosher [MVP-Outlook]

Do you have CDO 1.21 installed on this machine? Rerun Outlook or Office
setup to check.

You might also try using this statement for your cdoSession.Logon:

cdoSession.Logon "", "", false, false
 
K

Ken Slovak - [MVP - Outlook]

On which lines do you get the errors?

Outlook version? Do you have CDO 1.21 (CDO.DLL) installed?
 

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