CDO AddressBook Err number 424 Object required

S

sharon zadok

i have XP professional and office 2003SP1
this method (OLE) works well but in some cases the OLE return nothing
even when
i select a recipient in most cases its retun an object .

sample:
the OLE opend i select recipient "sharon" i get a error 424 and then
'i do the same operation and its return object.
i never found any document about the this error.
the login session is allready initilized in all cases



Set objRecipients = cdoSession.AddressBook(, "SMS to list", , , ,
"SMS to", , , hwnd)
'if user canceled the selection from the
If Err.Number = -2147221229 Then address book window
GoTo Ex
End If

'here i get error: 424 Object required
If Err.Number <> 0 Then

MsgBox str(Err.Number) + vbTab + Err.Description
End If

If objRecipients.count = 0 Then
GoTo Ex
End If
 
M

Michael Bauer

Hi Sharon,

I don´t know, why the same operation sometimes returns an object and
sometimes it doesn´t.
'here i get error: 424 Object required
If Err.Number <> 0 Then

But I´m pretty sure that this line doesn´t cause an Error 424.
 
K

Ken Slovak - [MVP - Outlook]

Is hwnd always valid and not 0? Try setting a breakpoint on the error check
line after the return from Session.AddressBook and see if the 424 is coming
in there.

Are you by chance using cached mode in Outlook 2003?
 
S

sharon zadok

hello Michael Bauer

yes i know that the error not comes from the line i specified.
its from the OLE in the cdoSession.AddressBook method

if i understand you well its happens sometime to all develpers(you
also)
and there is no way to solve this problame,i have not seen any
reffernce about this issue in all news group.

regards
 
M

Michael Bauer

Hi Sharon,

no, I just said that I don´t know why. I´ve never experienced that
(maybe) because I´ve never used the AddressBook method so far? Please
see also Ken´s post.
 
S

sharon zadok

hello Michael Bauer

in you question you ask if i use cache mode ,
yes my outlook is configured to work with cache exchange mode

ill do testing without the cache exchange mode any way.

thx
 
S

sharon zadok

hello Michael Bauer

yes use cache exchange mode ,ill test my app witout the cache exchange mode any way.
about ken's replys i allready searched and nothing was relevent

thx.
 
M

Michael Bauer

Hi Sharon,

sorry, I also never talked about any cache mode. I think, you¡¦d need to
wait for Ken...
 
S

sharon zadok

hello Ken Slovak

the hwnd is alwayes not 0.
i found somthing when the Addressbook is open after waiting 3 minute i
select a recipient press ok and then i get the 424 error and hwnd is
valid(all the time happed).
but still after avrage of 10-20 recipient even i dont wait i get 424.
do we know any problam of waiting while OLE(addressbook) is shown?

thx



i remove the cache exchange mode and still its the same.
 
K

Ken Slovak - [MVP - Outlook]

I don't know of any problems with waiting to receive a return from
Session.AddressBook, CDO has no conception of a timeout for that.

The only times I've seen Session.AddressBook fail is when using Outlook 2000
Internet only mode if certain arguments to AddressBook are specified at all,
such as OneAddress. For some reason if that argument isn't skipped over CDO
chokes if you are using Internet only mode in Outlook 2000. Other than that
if the wrong version of CDO is installed for the corresponding version of
Outlook or with an upgrade scenario if CDO isn't correctly registered I've
seen things like that but in general all CDO calls would fail in that case.

Some things that you might want to try are a new Outlook profile or deleting
the OST file and letting Outlook re-create it. You can also see if not using
hwnd (the ParentWindow argument) makes a difference.

One other thing, where is this code running? Inside Outlook as a macro or
COM addin or from external code that automates Outlook? Language used is VBA
or VB 6?
 

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