A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

how to get mail's receivedTime?



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old April 11th 06, 11:31 AM posted to microsoft.public.outlook.program_vba
StupidDog
external usenet poster
 
Posts: 7
Default how to get mail's receivedTime?

_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!


--
只要决心成功,失败永远不会把我击垮!
Ads
  #2  
Old April 13th 06, 05:04 PM posted to microsoft.public.outlook.program_vba
Eric Legault [MVP - Outlook]
external usenet poster
 
Posts: 830
Default how to get mail's receivedTime?

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

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

--
Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"StupidDog" wrote:

_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!


--
只要决心成功,失败永远不会把我击垮!

 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to check an Outlook mail's *edit mode*? N More Outlook and VBA 2 March 9th 06 08:44 PM


All times are GMT +1. The time now is 08:57 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright 2004-2025 Outlook Banter.
The comments are property of their posters.