VB script fails in Outlook 2003 cache mode - retrieving SentOn property

G

GlenD

I am running Outlook 2003 in cache moed to an exchange server 2003. I
am trying to resolve a problem accessing the SentOn property for
MailItems residing in the Inbox (ost) folder.

When the script runs in non cache mode it works as expected - when in
cache mode it fails.

Need some help in either a work around that will work regardless of the
mode cache or non cache .

Below is code snip of the:

------------------------------------------
Set oFolder = oApp.ActiveExplorer.CurrentFolder
Item.UserProperties.Find("ItemsInInbox") = oFolder.Items.Count
Item.UserProperties.Find("FoldersInInbox") = oFolder.Folders.Count
Item.UserProperties.Find("UnReadItemInInbox")= oFolder.UnReadItemCount
Set myItem = oFolder.Items.GetLast
MsgBox "Type Item is " & TypeName(myItem)
' Set oMapiItem = GetCDOItemFromOL(myItem)
myDate = FormatDateTime(myItem.SentOn,0) ' ***** failure here in
cache mode ****
mySubject = myItem.Subject
MsgBox " The Date this item was sent was " & myDate
Item.UserProperties.Find("InboxOldestUnReadItem") = myDate

MsgBox " Current folder is - " & oFolder.Name & ". It has " &
CStr(oFolder.Folders.Count) & " folders in it"
MsgBox " and " & oFolder.Name & " has " & CStr(oFolder.Items.Count)
& " in it."
MsgBox " of which " & CStr(oFolder.UnReadItemCount) & " items are
unread" & " and item(2) has a subject of " & mySubject
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top