how to get mail's receivedTime?

S

StupidDog

_ApplicationPtr pApp("Outlook.Application");
_NameSpacePtr pNameSpace = pApp->GetNamespace(L"MAPI");
MAPIFolderPtr pOutbox = pNameSpace->GetDefaultFolder(olFolderInbox);
_ItemsPtr pOutboxItems = pOutbox->Items;
_MailItemPtr pNewMail=pItems->GetFirst();
DATE date = pNewMail->GetReceivedTime();

i want read the receivedTime, i get the val is DATE type. but i don't know
how to change the val to time. like 2006-04-11 22:26
DATE type is double type, please help me!
 
E

Eric Legault [MVP - Outlook]

You can use the VBA Format function with some named formatting arguments:

Debug.Print Format(Date & " " & Time, "HH:MM")
 

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