CDO problem 
Author Message
 CDO problem

Hello

Although I've done a lot of VB/VBA/VBScript programming, I've never used
Access before, so bear with me if this question is stupid, unclear or in the
wrong newsgroup.....

I have been given an Access program to access our Group Address List and
provide me with all the locations of all the users.  Very nice, except that
it doesn't work!  I have found why it crashes but am unsure how to work
around it.

Basically, there are Distribution Lists in the GAL (which is fine) but there
is also at least one DL which doesn't contain any users.  So when the
AddressEntry.DisplayType is 1 (that of a DL) but when it comes to the line
AddressEntry.Members it crashes with a run-time error - Collaboration Data
Objects - [E_FAIL(80004005)]

Really, I want to say

    If AddressEntry.Members.Count = 0 Then
        Exit Loop
    End If

but this doesn't work as whenever I try to access AddressEntry.Members the
program crashes.  Is there any way to check whether the DL is empty?

Any suggestions welcome -I can post more code if necessary

Thanks

Nicola



Sat, 09 Nov 2002 03:00:00 GMT  
 CDO problem
Nicola,
Maybe you can check for the error, (if it is trappable).
Something like;
On Error Resume Next
iDummy = AddressEntry.Members.Count
If err <> 0 then 'You've hit an error
    'Handle the error
    Err.Clear
    Exit Loop
End if
On Error goto ErrHandler
'Carry on

What sort of object is AddressEntry? A class?
Yes, a bit more code would add to the fun.
--

Hope This Helps,
Jeff Davies


Quote:
> Hello

> Although I've done a lot of VB/VBA/VBScript programming, I've never used
> Access before, so bear with me if this question is stupid, unclear or in
the
> wrong newsgroup.....

> I have been given an Access program to access our Group Address List and
> provide me with all the locations of all the users.  Very nice, except
that
> it doesn't work!  I have found why it crashes but am unsure how to work
> around it.

> Basically, there are Distribution Lists in the GAL (which is fine) but
there
> is also at least one DL which doesn't contain any users.  So when the
> AddressEntry.DisplayType is 1 (that of a DL) but when it comes to the line
> AddressEntry.Members it crashes with a run-time error - Collaboration Data
> Objects - [E_FAIL(80004005)]

> Really, I want to say

>     If AddressEntry.Members.Count = 0 Then
>         Exit Loop
>     End If

> but this doesn't work as whenever I try to access AddressEntry.Members the
> program crashes.  Is there any way to check whether the DL is empty?

> Any suggestions welcome -I can post more code if necessary

> Thanks

> Nicola



Sun, 10 Nov 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. CDO Problem within Outlook

2. CDO Problem using the GetMessage method to find a message in a Public Folder

3. CDO Problem

4. CDO Problem

5. cdo problem retrieving business address from entry in address book

6. CDO Problem with binary field

7. ASP & CDO - problem sending SMTP mail

8. cdo problem

9. CDO Problem

10. CDO Problem

11. CDO Problems+

12. CDO Problems in ASP

 

 
Powered by phpBB® Forum Software