PC Review


Reply
Thread Tools Rate Thread

-2147467259 Automation error with redemption

 
 
New Member
Join Date: May 2009
Posts: 2
 
      22nd Mar 2011
Hi,

If anybody could help me on the particular error, when trying to access the address list of a user from EXCHANGE SERVER 2010, with REDEMPTION. The issue the first set of code, provided below only returns a certain amount of data and errors out for a mail address, the second time the code is executed that particular mail address,gets retrieved and displayed without any error and errors out for another mail address. The piece of code that errors out is as below, and the exact statement where the error occurs has been bolded,

Private Sub DisplayExchangeUserData(iopt As Integer)
Dim AEnty As MAPI.AddressEntry
Dim AEntrs As MAPI.AddressEntries
Dim i As Integer
Dim sInfo As String
Dim str As String
Const CdoPR_EMS_AB_HOME_MTA = &H8007001E


Screen.MousePointer = vbHourglass
str = "/cn=Configuration/cn=Servers/cn="

If iopt = 0 Then 'ALL Users
Set AEntrs = moSession.AddressLists("All Users").AddressEntries
Else
Set AEntrs = moSession.AddressLists("Global Address List").AddressEntries
End If

For Each AEnty In AEntrs

If AEnty.DisplayType = CdoDisplayType.CdoUser Or _
AEnty.DisplayType = CdoDisplayType.CdoRemoteUser Then
On Error GoTo ErrorHandler
sInfo = AEnty.Fields(CdoPR_EMS_AB_HOME_MTA)
WriteServerInfo:
WriteToLogFile (AEnty.Fields(CdoPR_ACCOUNT) & " - " & sInfo)
End If

Next AEnty
Screen.MousePointer = vbNormal
Exit Sub
ErrorHandler:
WriteToLogFile (AEnty.Name & "Error : " & Err.Number & " - " & Err.Description)
GoTo WriteServerInfo
End Sub

Whereas the below code works fine...

Private Sub DisplayExchangeUserData(iopt As Integer)
Dim Table As Redemption.MAPITable
Const CdoPR_EMS_AB_HOME_MTA = &H8007001E
Dim Columns(2)
Dim Row

On Error GoTo ErrorHandler1

Const CdoPR_EMS_AB_HOME_MTA = &H8007001E
Screen.MousePointer = vbHourglass
Set Table = CreateObject("Redemption.MAPITable")

If iopt = 0 Then 'ALL Users
Table.Item = roSession.AddressBook.AddressLists.Item("All Users").AddressEntries
Else
Table.Item = roSession.AddressBook.AddressLists.Item("Global Address List").AddressEntries
End If

Columns(0) = CdoPR_ACCOUNT
Columns(1) = CdoPR_EMS_AB_HOME_MTA
Columns(2) = CdoPR_DISPLAY_TYPE

Table.Columns = Columns
Table.GoToFirst

WriteToLogFile (Now & "MAPITable Method")
Do While Not IsEmpty(Row)
If ((Row(2)) = 0 Or Row(2) = 6) Then
WriteToLogFile (CStr(Row(0)) & " - " & CStr(Row(1)))
End If
Table.GoToNext
Loop
WriteToLogFile (Now & " MAPITable Method Complete" & vbCrLf & vbCrLf)
End Sub

Please advice whether there are any setting in Exchange Server 2010, that could be limiting the number of records being retrieved, or is this a know issue, where the MAPI.AddressEntries has to be replaced with MAPITABLES.

Thanks in advance for the help extended.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Redemption insert text - Run-time error '-2147467259 (80004005)' Unspecified Error JW Microsoft Outlook VBA Programming 16 22nd Dec 2007 10:26 PM
ado automation error -2147467259 =?Utf-8?B?RG9t?= Microsoft Access VBA Modules 0 4th May 2005 04:50 PM
Re: Automation Error(-2147467259) in Properties Collection Bob Phillips Microsoft Excel Programming 1 14th Apr 2005 07:08 PM
Re: Automation Error(-2147467259) in Properties Collection Bob Phillips Microsoft Excel Programming 0 14th Apr 2005 04:27 PM
automation error -2147467259 Tim Cadieux Microsoft Excel Programming 0 5th Nov 2003 05:01 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:56 PM.