Outlook attachment's date modified

C

Cedric

Hello,

Is there any way to get the date modified of an Outlook MailItem Attachment
file, short of first saving it in the filesystem (Attachment.SaveAsFile) then
using .Net File.GetLastWriteTime?

This would be prohibitively expensive if the attachment is big.

Thanks.
 
K

Ken Slovak - [MVP - Outlook]

If you're using an API other than the Outlook object model you can get the
properties of the attachment that aren't exposed in the object model such as
PR_CREATION_TIME and PR_LAST_MODIFICATION_TIME. Those properties are
available if you use CDO 1.21 or Extended MAPI (C++ or Delphi only) or
Redemption or another MAPI wrapper library. CDO and Extended MAPI also
aren't supported for use with managed code.

If you are using Outlook 2007 you can use the PropertyAccessor object of the
Attachment to get the PR_CREATION_TIME and PR_LAST_MODIFICATION_TIME
properties.

Otherwise you have to save out the attachment to the file system and get the
properties that way.
 
C

Cedric

Thanks,

I tried to find that property with MFCMapi but it didn't appear.

Nonetheless, it works!

Cedric
 

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