P
Peter Marchert
Hello,
I did my first steps with MapiTable and it seems to be simple to
handle but this code does not work:
Sub MapiTableTest()
Dim objFolder As Outlook.MAPIFolder
Dim objTable
Dim Columns(2)
Dim Row
Const PR_SUBJECT As Long = &H37001E
Const PR_ENTRYID As Long = &HFFF0102
Const PR_STORE_ENTRYID As Long = &HFFB0102
Set objFolder = Outlook.ActiveExplorer.CurrentFolder
If objFolder.Items.Count > 0 Then
Set objTable = CreateObject("Redemption.MAPITable")
objTable.Item = objFolder.Items
Columns(0) = PR_SUBJECT
Columns(1) = PR_ENTRYID
Columns(2) = PR_STORE_ENTRYID
objTable.Columns = Columns
objTable.GoToFirst
Do
Row = objTable.GetRow
If Not IsEmpty(Row) Then
Debug.Print Row(0)
Debug.Print Row(1)
Debug.Print Row(2)
End If
Loop Until IsEmpty(Row)
End If
End Sub
Row(1) and Row(2) always return a type mismatch error. I don`t know
why and need some help. Row(0) returns the subject of the item without
problems.
Beside this problem I want to ask if there is a simple way to compare
two mapi tables? For example to compare the email adress and the
subject of all items in two folders and get only the different items.
Thanks in advanced!
Peter
I did my first steps with MapiTable and it seems to be simple to
handle but this code does not work:
Sub MapiTableTest()
Dim objFolder As Outlook.MAPIFolder
Dim objTable
Dim Columns(2)
Dim Row
Const PR_SUBJECT As Long = &H37001E
Const PR_ENTRYID As Long = &HFFF0102
Const PR_STORE_ENTRYID As Long = &HFFB0102
Set objFolder = Outlook.ActiveExplorer.CurrentFolder
If objFolder.Items.Count > 0 Then
Set objTable = CreateObject("Redemption.MAPITable")
objTable.Item = objFolder.Items
Columns(0) = PR_SUBJECT
Columns(1) = PR_ENTRYID
Columns(2) = PR_STORE_ENTRYID
objTable.Columns = Columns
objTable.GoToFirst
Do
Row = objTable.GetRow
If Not IsEmpty(Row) Then
Debug.Print Row(0)
Debug.Print Row(1)
Debug.Print Row(2)
End If
Loop Until IsEmpty(Row)
End If
End Sub
Row(1) and Row(2) always return a type mismatch error. I don`t know
why and need some help. Row(0) returns the subject of the item without
problems.
Beside this problem I want to ask if there is a simple way to compare
two mapi tables? For example to compare the email adress and the
subject of all items in two folders and get only the different items.
Thanks in advanced!
Peter