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

Extracting received time from an email message



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old January 10th 08, 06:26 PM posted to microsoft.public.outlook.program_vba
S Shipley
external usenet poster
 
Posts: 2
Default Extracting received time from an email message

I have used VBA for Excel and Word but this is my first foray into VBA for
Outlook so please forgive the newbie. I need to create a macro that takes an
open received email item and:
Extracts the From email address
The received time (need to have this in hh:mm:ss)
Displays both of these values in a message box
Is this even possible?

Thanks in advance for the help,
Sam

Ads
  #2  
Old January 10th 08, 06:56 PM posted to microsoft.public.outlook.program_vba
JP[_3_]
external usenet poster
 
Posts: 201
Default Extracting received time from an email message

Sure, how about this?

Sub GetStuff()
Dim CurrentMsg As Outlook.MailItem
Set CurrentMsg = ActiveInspector.CurrentItem

MsgBox CurrentMsg.SenderEmailAddress & vbCr & vbCr & _
Format(CurrentMsg.ReceivedTime, "HH:MM:SS")

End Sub


Just double click to open the msg, then run this code.

HTH,
JP


On Jan 10, 1:26*pm, S Shipley
wrote:
I have used VBA for Excel and Word but this is my first foray into VBA for
Outlook so please forgive the newbie. *I need to create a macro that takes an
open received email item and:
* Extracts the From email address
* The received time (need to have this in hh:mm:ss)
* Displays both of these values in a message box
Is this even possible?

Thanks in advance for the help,
Sam


  #3  
Old January 10th 08, 07:33 PM posted to microsoft.public.outlook.program_vba
S Shipley
external usenet poster
 
Posts: 2
Default Extracting received time from an email message

Thanks JP - just what the doctor ordered.

"JP" wrote:

Sure, how about this?

Sub GetStuff()
Dim CurrentMsg As Outlook.MailItem
Set CurrentMsg = ActiveInspector.CurrentItem

MsgBox CurrentMsg.SenderEmailAddress & vbCr & vbCr & _
Format(CurrentMsg.ReceivedTime, "HH:MM:SS")

End Sub


Just double click to open the msg, then run this code.

HTH,
JP


On Jan 10, 1:26 pm, S Shipley
wrote:
I have used VBA for Excel and Word but this is my first foray into VBA for
Outlook so please forgive the newbie. I need to create a macro that takes an
open received email item and:
Extracts the From email address
The received time (need to have this in hh:mm:ss)
Displays both of these values in a message box
Is this even possible?

Thanks in advance for the help,
Sam



 




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
Received eMail Message Not Showng pmitch Outlook Express 1 September 9th 07 10:46 AM
I cannot open a URL in a received email message in Outlook 2003 Paul Mayer Outlook - General Queries 1 July 11th 07 08:00 PM
adding multiple contacts at one time from a received email [email protected] Outlook - General Queries 4 November 5th 06 02:56 AM
Email message auto opens when received Moresteins Outlook - Installation 0 October 20th 06 09:07 PM
How do i change the sent time to received time in outlook message? Freedom Outlook - General Queries 1 August 1st 06 02:42 PM


All times are GMT +1. The time now is 10:59 AM.


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.