Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming Forms / August 2004

Tip: Looking for answers? Try searching our database.

Error 424 Object Required

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Karen - 03 Aug 2004 10:42 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.