McKilty
2009-10-02 14:49:32 UTC
Hello all,
I'm having trouble sorting an items collection. I'm sure that this is
a coding issue, but I don't know how to properly resolve it so I'd
like your help.
What I believe to be the issue is my items collection variable,
mItemCollection, is not declared as items, but then when I declare it
as such, my other code before it fails.
I very much appreciate any help you can give me.
--------------------------------------------------------
Dim myOutlook As Outlook.Application
Dim myNameSpace As Namespace
Dim myMailItem
Dim mItemCollection
Dim SafeMail
Dim Session
Dim Search
Dim SearchRoot As Redemption.RDOFolder
Set myOutlook = CreateObject("Outlook.Application")
Set myNameSpace = myOutlook.GetNamespace("MAPI")
Set Session = CreateObject("Redemption.RDOSession")
Session.Logon
Set SearchRoot = Session.Stores.DefaultStore.SearchRootFolder
Set Search = SearchRoot.Folders.Item("Current Sent & Received")
Set mItemCollection = Search.Items ' RDOItems
Set mItemCollection = mItemCollection.Restrict("[SentOn] > '" _
& Format(dteStart, "yyyy-mm-dd hh:nn:ss") _
& "' AND [SentOn] < '" & Format(dteEnd, "yyyy-mm-dd hh:nn:ss") &
"'")
Set mItemCollection.Sort "[ReceivedTime]", False
---------------------------------------------------------------
The error I receive is: Invalid column property tag value:
[ReceivedTime]
If I declare mItemCollection as Items then it fails with a Type
Mismatch on:
Set mItemCollection = Search.Items ' RDOItems
If I declare Search as Items then it fails with a Type Mismatch:
Set Search = SearchRoot.Folders.Item("Current Sent & Received")
I'm having trouble sorting an items collection. I'm sure that this is
a coding issue, but I don't know how to properly resolve it so I'd
like your help.
What I believe to be the issue is my items collection variable,
mItemCollection, is not declared as items, but then when I declare it
as such, my other code before it fails.
I very much appreciate any help you can give me.
--------------------------------------------------------
Dim myOutlook As Outlook.Application
Dim myNameSpace As Namespace
Dim myMailItem
Dim mItemCollection
Dim SafeMail
Dim Session
Dim Search
Dim SearchRoot As Redemption.RDOFolder
Set myOutlook = CreateObject("Outlook.Application")
Set myNameSpace = myOutlook.GetNamespace("MAPI")
Set Session = CreateObject("Redemption.RDOSession")
Session.Logon
Set SearchRoot = Session.Stores.DefaultStore.SearchRootFolder
Set Search = SearchRoot.Folders.Item("Current Sent & Received")
Set mItemCollection = Search.Items ' RDOItems
Set mItemCollection = mItemCollection.Restrict("[SentOn] > '" _
& Format(dteStart, "yyyy-mm-dd hh:nn:ss") _
& "' AND [SentOn] < '" & Format(dteEnd, "yyyy-mm-dd hh:nn:ss") &
"'")
Set mItemCollection.Sort "[ReceivedTime]", False
---------------------------------------------------------------
The error I receive is: Invalid column property tag value:
[ReceivedTime]
If I declare mItemCollection as Items then it fails with a Type
Mismatch on:
Set mItemCollection = Search.Items ' RDOItems
If I declare Search as Items then it fails with a Type Mismatch:
Set Search = SearchRoot.Folders.Item("Current Sent & Received")