exchangefreaks.com Forum Index
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

E_Fail during Session.GetAddressList funciton call

 
Post new topic   Reply to topic    exchangefreaks.com Forum Index -> MS Exchange Applications
Author Message
JR



Joined: 05 Aug 2007
Posts: 1

PostPosted: Mon Oct 06, 2003 6:23 pm    Post subject: E_Fail during Session.GetAddressList funciton call Reply with quote

Hello

Im trying to get email addresses out of the global address list and
write them out to a web page. I am using Exchange 5.5. This is a
asp.net application running on an XP machine. It uses version 1.21 of
MS CDO.

The code is as follows:

Dim strProfileInfo As String
Dim ObjSession As New MAPI.Session
Dim objAddressListType As New MAPI.CdoAddressListTypes
Dim objAddressList
Dim objAddressEntry

Dim strServer As String = "" --I have a valid sever here
Dim strMailbox As String = "" --I have a valid mailbox
here


strProfileInfo = strServer & vbLf & strMailbox
ObjSession.Logon(, , False, True, , True, strProfileInfo)

objAddressList =
ObjSession.GetAddressList(objAddressListType.CdoAddressListGAL)

'list all addresses in the gal
For Each objAddressEntry In objAddressList
Response.Write(objAddressEntry.Address())
Next


The code fails during the GetAddressList function with a

"[Collaboration Data Objects - [E_FAIL(80004005)]] " error message.

Any help here would be very much appreciated.

Thanks.

Jeff

Archived from group: microsoft>public>exchange>applications
Back to top
View user's profile Send private message
Siegfried Weber [MVP]



Joined: 05 Aug 2007
Posts: 16

PostPosted: Thu Oct 09, 2003 6:01 pm    Post subject: Re: E_Fail during Session.GetAddressList funciton call Reply with quote

"JR" wrote in message:
>
> Im trying to get email addresses out of the global address list and
> write them out to a web page. I am using Exchange 5.5. This is a
> asp.net application running on an XP machine. It uses version 1.21 of
> MS CDO.
>
> The code is as follows:
>
> Dim strProfileInfo As String
> Dim ObjSession As New MAPI.Session
> Dim objAddressListType As New MAPI.CdoAddressListTypes
> Dim objAddressList
> Dim objAddressEntry
>
> Dim strServer As String = "" --I have a valid sever here
> Dim strMailbox As String = "" --I have a valid mailbox
> here
>
>
> strProfileInfo = strServer & vbLf & strMailbox
> ObjSession.Logon(, , False, True, , True, strProfileInfo)
>
> objAddressList =
> ObjSession.GetAddressList(objAddressListType.CdoAddressListGAL)
>
> 'list all addresses in the gal
> For Each objAddressEntry In objAddressList
> Response.Write(objAddressEntry.Address())
> Next
>
>
> The code fails during the GetAddressList function with a
>
> "[Collaboration Data Objects - [E_FAIL(80004005)]] " error message.

The problem you are facing is that the user account you use to run the code
doesn't have permissions to access this mailbox. CDO 1.21 doesn't throw an
error when you logon but rather when you are trying to access any data.
Since this is a Web application you might want to look at
http://www.cdolive.com/asp.htm for some pointer how to work around thsoe
security issues.

--
Cheers,

Siegfried Weber

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    exchangefreaks.com Forum Index -> MS Exchange Applications All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group