PDA

View Full Version : Date and Time Stamp



AlanFD
03-16-2011, 07:23 PM
I need to respond to email and send them back to the Sender as

CONFIRMED 01-01-2011 15:35

The Date and time would be current for that particular day and the time is in the 24 hr format.

Can I use Excel VBA to right this code or does Outlook have it's own VBA code. Outlook 2007.

JP2112
03-22-2011, 06:28 AM
I would do this in Outlook. Select an email you want to reply to and run this code:


Sub ReplyWithTime()
Dim msgReply As Outlook.MailItem
Set msgReply = ActiveExplorer.Selection.Item(1).reply
With msgReply
.body = "CONFIRMED " & Format(Now, "mm-dd-yyyy hh:mm") & vbCrLf & .body
.Display
End With
End Sub

AlanFD
03-22-2011, 07:33 PM
Many thanks for the code, I'll give it a go tomorrow, thanks again.

AlanFD
03-24-2011, 08:32 PM
I tried the code for the stamp and it works great, I was wondering though, where would I put the code to increase the font size to bold and 22 pt?

JP2112
03-25-2011, 12:53 PM
Instead of .Body you would use the .HTMLBody property. Then you can use CSS styling as normal.

AlanFD
03-25-2011, 05:22 PM
Excellent, thank you very much.