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
Sue Mosher [MVP-Outlook] - 03 Aug 2004 12:53 GMT
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

Signature
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx
> Dear All,
>
[quoted text clipped - 32 lines]
> Set cdoAddrEntry = Nothing
> Set cdoSession = Nothing
Ken Slovak - [MVP - Outlook] - 03 Aug 2004 13:39 GMT
On which lines do you get the errors?
Outlook version? Do you have CDO 1.21 (CDO.DLL) installed?

Signature
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm
> Dear All,
>
[quoted text clipped - 32 lines]
> Set cdoAddrEntry = Nothing
> Set cdoSession = Nothing