using MAPITABLE & Redemption

Joined
Apr 12, 2007
Messages
2
Reaction score
0
Hi,

I'm trying to get all emails that are in my inbox folder and once upon retrieved, I want to move them to another folder. To do it faster, I wanted to use MAPItable from redemption.

Here is my code :

oSession = CreateObject("Redemption.RDOSession")
oSession.LogonExchangeMailbox("umonitor", PropBoxAddress)
PropFolder = oSession.GetDefaultFolder(6) //repertoire Inbox

Dim Table = CreateObject("Redemption.MAPITable")
Dim PR_SUBJECT = &H37001E
Dim PR_SENDER_NAME = &HC1F001E
Dim PR_BODY = &H1000001E
Dim PR_MESSAGE_DELIVERY_TIME = &HE060040
Dim PR_ENTRYID = &HFFF0102

Table.Item = PropFolder.Items //get all items to table
Columns(0) = PR_ENTRYID
Columns(1) = PR_MESSAGE_DELIVERY_TIME

Table.Columns = Columns
Table.Sort(PR_MESSAGE_DELIVERY_TIME, False)
Table.GoToFirst()

While PropFolder.Items.Count > 0

For i As Integer = 0 To 20 //getting 20 par 20 mails

' Table.Item = PropFolder.Items
Row = Table.GetRow
If (Row Is Nothing) = False Then
entryID = Row(0)
strEntryID = utils.HrArrayToString(Row(0))
mail = oSession.GetMessageFromID(strEntryID)
listOfEmails.Add(mail )
mail.move(PropArchiveFolder) // Move it to other folder

Table = Nothing
Table = CreateObject("Redemption.MAPITable")
Table.Item = PropFolder.Items
Columns(0) = PR_ENTRYID
Columns(1) = PR_MESSAGE_DELIVERY_TIME
Table.Columns = Columns
Table.Sort(PR_MESSAGE_DELIVERY_TIME, False)
Table.GoToFirst()
end if
next

In order to didn't get too many parameters for MAPI , I'm reading them 20 per 20 but I always got a message error MAPI_E_TOO_BIG.
How can I do this ?

Thanks
 
Back
Top