Is this the code you are using?
ItemTime = MyItems(MyItems.Count).SentOn
It looks like you are casting an integer property (Items.Count) to an object
(MyItems?).
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
> Hi,
>
> I'm trying to archive old emails based on their SentOn, ReceivedTime, or CreationTime properties. I can get the value for these properties for any
item except the items in the "Sent Items" folder. E.g., when I try to get
the SentOn time, I get an error.
> ItemTime = MyItems(MyItems.Count).SentOn
>
> Error: "Run-time error '-2147168452 (8004cf3c)':
> "Method 'SentOn' of object 'MailItem' failed.
>
> In fact, I've found that very few mailitem properties work for me in the Sent Items folder. E.g., "subject", "Class", "MessageClass" work, but To,
SenderName, SentOn, ReceivedTime, CreationTime don't.
> Once I get the date/time of the message, I'll be moving it to a location in a different PST based on that date/time. Will I be able to move it ok?
Rick Andrews - 27 Nov 2003 21:36 GMT
Duh. :-) Sorry about that. ItemTime is a Date Variable. MyItems is a collection of Items, i.e.
Dim myItems As Outlook.Item
Dim ItemTime As Dat
I've since found several other times where the SentOn property fails even though the item type is a "MailItem" that aren't in the Sent Items folder. E.g., recall requests return that they are "MailItems"s, but if I query the SentOn date, I get the same error I reported earlier
Ric
----- Dmitry Streblechenko wrote: ----
Is this the code you are using
ItemTime = MyItems(MyItems.Count).SentO
It looks like you are casting an integer property (Items.Count) to an objec
(MyItems?)
Dmitry Streblechenko (MVP
http://www.dimastr.com
OutlookSpy - Outlook, CD
and MAPI Developer Too
"Rick Andrews" <anonymous@discussions.microsoft.com> wrote in messag
news:31721F31-4617-4732-8541-3BC783AE026F@microsoft.com..
> Hi
>> I'm trying to archive old emails based on their SentOn, ReceivedTime, o
CreationTime properties. I can get the value for these properties for an
item except the items in the "Sent Items" folder. E.g., when I try to ge
the SentOn time, I get an error
>> ItemTime = MyItems(MyItems.Count).SentO
>> Error: "Run-time error '-2147168452 (8004cf3c)'
> "Method 'SentOn' of object 'MailItem' failed
>> In fact, I've found that very few mailitem properties work for me in th
Sent Items folder. E.g., "subject", "Class", "MessageClass" work, but To
SenderName, SentOn, ReceivedTime, CreationTime don't
>> Once I get the date/time of the message, I'll be moving it to a locatio
in a different PST based on that date/time. Will I be able to move it ok
Dmitry Streblechenko - 27 Nov 2003 22:50 GMT
Can you see PR_CLIENT_SUBMIT_TIME and PR_MESSAGE_DELIVERY_TIME on these
messages using MdbView or OutlookSpy?
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
> Duh. :-) Sorry about that. ItemTime is a Date Variable. MyItems is a collection of Items, i.e.,
>
> Dim myItems As Outlook.Items
> Dim ItemTime As Date
>
> I've since found several other times where the SentOn property fails even though the item type is a "MailItem" that aren't in the Sent Items folder.
E.g., recall requests return that they are "MailItems"s, but if I query the
SentOn date, I get the same error I reported earlier.
> Rick
>
[quoted text clipped - 25 lines]
> >> Once I get the date/time of the message, I'll be moving it to a location
> in a different PST based on that date/time. Will I be able to move it ok?