Last reviewed on July 28, 2012   —  29 Comments

One often requested feature that is missing in older versions of Outlook is ability to insert a date and time stamp into the body of Outlook items. While Outlook doesn't offer it directly, you can use a custom form or an add-in to insert the date stamp.

While this is not needed in Outlook 2007 and Outlook 2010 as both include the Insert Date and Time command found in Word, you can use it if you prefer.

One complaint about Outlook 2007, 2010 or 2013’s Insert Date & Time command is that it is too many steps. It’s not bad if you use the keyboard shortcuts: Alt+N, D, Enter will insert the date and time format you have set as default. To insert other formats, use the arrow keys to select them, then press Enter. (Home or Page Up jumps to the top entry on the list while End or Page Down jumps to the bottom.)

See the Tools section below for add-ins that you can use instead. Note that the custom forms method doesn't work well with Appointment forms since you can't change the first page of the form. It also doesn't work well with contacts in Outlook 2003 and 2007 since editing the first page of the form reverts the form to the older Outlook contact form (as in the screenshot below).

Custom Form Method with Button

In a new Outlook 2003 or older, open a form then:

  1. Select the Tools menu, Forms, Design this form
  2. Then from the View menu, choose View code
  3. In the code window, enter this code:

In Outlook 2007 and up, first show the Developer ribbon (File or Office icon, Options), then from the Developer ribbon, choose Design this form. The View Code button is in the Form section.

Sub StampDate()
   Item.Body = Now() & vbCrLf & vbCrLf & Item.Body
End Sub

Sub CommandButton1_Click() 
  Call StampDate() 
End Sub

Add a date stamp to a custom form After entering the code, close the code window.


  1. Open the Control toolbox and drag a command button to the form.
  2. Rename it by right clicking on it and selecting Properties.
  3. In the Caption field, type in the desired name.

To use, click the button you created.

Custom Form – Automatic Method

If you want the date stamped in the Notes field every time you open an item, you can create a custom form as described above, but use the code below instead. You also won’t need to add a button to the form, so it will work with contacts. Although today’s date is added to the Notes field every time you open a contact, it’s not saved until you Save the contact.

In Outlook 2007 and up, first show the Developer ribbon (File or Office icon, Options), then from the Developer ribbon, choose Design this form. The View Code button is in the Form section.

In Outlook 2003 and older, or Outlook 2007’s main window, go to Tools menu, Forms, Design this form. Then from the View menu, choose View code.

In the code window, enter this code:

Function Item_Open()
Item.Body = Now() & vbCrLf & vbCrLf & Item.Body
End function

Publish the form and set it as the default form for the folder, if desired. If you want to use it with existing items you’ll need to convert the items to use the new form. Instructions are at How to Set a Custom Form as the Default for a Folder.



Used to change the message class of Outlook items,so that existing items will use newly created forms.Free.

Insert Date-Time

Stamp any Outlook item with your name and the date/time, in various formats and locations. Enter code WD9BHK53 during checkout.

More Information

To stamp a date on a Microsoft Outlook item (Outlookcode)


  1. Jessica Jablonski says

    Diane -
    Can you tell me why when you try to edit the first page of the contact form that it reverts back to 2003 layout? It is so frustrating... is there any way to fix/update this?

    • Diane Poremsky says

      There is no fix - you need to use page 2 for customizations. Sorry. I don't recall the specifics of why the front page is not editable - it has to do with how they added the business card.

  2. Charlie Cato says

    Diane -

    I've tried the steps outlined above to add a custom button to an Outlook 2010 Contact form to automatically add the Date/Time when clicked..

    When I first entered the code exactly as shown and ran the form in Developer Mode, I got a Script Error telling me that a "Sub" was expected in Line 7 of the Script, i.e. the line in your sample code above which is coded as "End".

    So I added a "Sub" command to that line. The code as now showing in the Code Viewer is:

    Sub StampDate()
    Item.Body = Now() & vbCrLf & vbCrLf & Item.Body
    End Sub

    Sub CommandButton1_Click()
    Call StampDate()
    End Sub
    End Sub

    The form now runs OK in Developer mode and the button shows up as expected on the Contact form. The problem is, when you click it, it does nothing. So I concludethat something is amiss in the "StampDate" sub-routine, but I don't know enough about Visual Basic to figure it out. (My glory days as a coder were 20+ years ago in the days of dBase II!)

    Can you give me any guidance. Thank you.

    • Diane Poremsky says

      The extra End Sub is not needed - remove the End instead. It shouldn't be there.

  3. Lino Wchima says

    Hi Diane,

    I adapted an earlier code published by you, in order to insert the today date in a message body by clicking a button in my ribbon:

    Sub InsertarFechaDeHoy()

    ' Por una única vez en Visual Basic de Outlook (Alt+F11):
    ' Add reference to Word library in VBA Editor, Tools, References

    Dim objItem As Object
    Dim objInsp As Outlook.Inspector

    Dim objWord As Word.Application
    Dim objDocu As Word.Document
    Dim objSele As Word.Selection

    On Error Resume Next

    'Reference the current Outlook item
    Set objItem = Application.ActiveInspector.CurrentItem

    If Not objItem Is Nothing Then
    If objItem.Class = olMail Then
    Set objInsp = objItem.GetInspector
    If objInsp.EditorType = olEditorWord Then
    Set objDocu = objInsp.WordEditor
    Set objWord = objDocu.Application
    Set objSele = objWord.Selection

    objSele.InsertDateTime DateTimeFormat:="yyyy-MM-dd", InsertAsField:= _
    False, DateLanguage:=wdSpanishColombia, CalendarType:=wdCalendarWestern, _

    End If
    End If
    End If

    Set objItem = Nothing
    Set objWord = Nothing
    Set objSele = Nothing
    Set objInsp = Nothing

    End Sub

    It works great, thank you.

    Could it be easier using only SendKeys?

    • Diane Poremsky says

      No, not really. SendKeys is clumsy and not a good solution when VBA can handle it.

      If you use Outlook 2007 or up, you can insert today's date using Alt+N,D then Enter (if the desired format is set as default).

  4. Alex Z says

    Hello DIane!!!
    Im really liking what you did here and was wondering if that could be implemented into what im trying to do.
    Body of my email message
    Date and Time: System Generated.(The computer's time should be time-stamped in this email.)
    Event Type: {Outage, Degradation,Information,...}
    Location: {Germantown, North Las Vegas, Detroit,...}
    Event Status: {Investigation,Outage,Information}

    An example of how I'm trying to set this email message up as

    Subject: (Status of the problem I'm sending)

    Date and Time: 02/01/2013
    Event Type: Outage
    Location: Germantown
    Event Status: Investigation

    Please if you could help me out I would be so grateful. I'm new to programming and have been looking around for weeks and nothing that could point me in the direction that I should be going for this. It would make my reports much easier if I could get this going. Its such a tedious thing for filling this out every day. I've been playing around with this but its becoming frustrating =(

  5. johnmerd says


    Thanks for your insert date code. I have modified it and it works great. How can I bold the first line and leave the remaining lines alone?

    Function Item_Open()
    Item.Body = Date() & " - " & Application.GetNamespace("MAPI").CurrentUser & " Notes:" & vbCrLf & vbCrLf & vbCrLf & "------------------------------------------" & vbCrLf & Item.Body
    End function

    I have spent several hours trying to do this. I would REALLY appreciate your help. Thanks. John,

    • Diane Poremsky says

      Wrapping it in works for some things but not for this. :( I think you'll need to use word vba commands but nothing i tried so far actually works.

  6. johnmerd says


    Thanks for your message. Seems like it would be a simple thing. I'm figuring if you don't know how to do it, maybe it can't be done. If you discover something that would work I would really appreciate an update. Thanks much.

    • Diane Poremsky says

      Yeah, I thought it should be simple too. My first try was using HTML for bolding "<strong>" & Date() & "</strong>" - that format works in something but is not working for this. It enters it as words. :(

  7. johnmerd says

    Thanks for the effort Diane. I am giving up on bolding for now. One more question. The code you provided enters the time/date stamp on the first line of the notes and pushes everything that was already in the notes down. Is it possible to leave a line or two at the top of the notes area alone so it doesn't get pushed down with everything else? I was hoping to use the first line for some company info that we would like fixed at the top of the notes area. Hope this one is easy!!!!! Thanks.

    • Diane Poremsky says

      you would need to parse the first line split it from the rest of the body, then insert your code in between. something like
      Function Item_Open()
      arr = Split(Item.Body, vbCrLf,2)
      Item.Body = arr(0) & Date() & " - " & Application.GetNamespace("MAPI").CurrentUser & " Notes:" & vbCrLf & vbCrLf & vbCrLf & "------------------------------------------" & vbCrLf & arr(1)
      End function

      this splits the body into 2 parts at the first line feed. if you need 2 lines, use a 3 in the split then arr(0) & arr(1) & date...

  8. johnmerd says


    Thanks much. This is what gave me the 2 lines. Added a vbCrlf in line 3. Works great.

    Function Item_Open()
    arr = Split(Item.Body,vbCrLf,2)
    Item.Body = arr(0) & vbCrLf & vbCrLf & Date() & " - " & Application.GetNamespace("MAPI").CurrentUser & " Notes:" & vbCrLf & vbCrLf & vbCrLf & "------------------------------------------" & vbCrLf & arr(1)
    End function

  9. johnmerd says


    This works, but the formatting of the first 2 lines is removed when it runs? Why is that? Is there a way to maintain the formatting? Almost there .....


    • Diane Poremsky says

      So far, I have not found out how yet... I'll ask some professional devs.

      BTW, this errors on items with not text in the Notes field. I added an If then statement
      if Item.Body <> "" then
      'run the code

      end if
      end function

    • Diane Poremsky says

      On the formatting, my expert had this to say:

      He should be able to use ContactItem.GetInspector.WordEditor to retrieve the Word Document object and insert the text using WOM. Or he can use the RtfBody property, which is a real PITA to work with since it must a variant array of byte (not a string) and he will be responsible for parsing and the modifying the RTF. Redemption is another option (of course) – RDOContacItem exposes the HTMLBody property, which Redemption dynamically converts to/from RTF used by the contact. But the contact must be saved first and Outlook might not immediately see the change.

  10. johnmerd says

    Thanks much. I'll have to dig into this.

    Question: When I open the calendar appointment, the date and lines are automatically inserted above the old notes as it's supposed to do according to the code we derived. However, when I just want to view the notes, Outlook thinks I made changes because of the date and lines inserted, and when I close I have to click on the x in the corner, and then answer the pesky "Do you want to save changes?" Pop up. Is there anyway to turn this off, or create a macro to close and then answer "no"? Any suggestions?


    • Diane Poremsky says

      Outlook has no way of knowing when you open a task if you want edit it or just read. One option would be to use a macro you kick off rather than an item_open macro. Or a macro to close without saving - you can use it with a close without saving button.

  11. johnmerd says


    Thanks for all your help. We view appointment details a lot without making changes, and so we are going to get around the issue by using a macro button on the Appointment Ribbon. I know how to create a macro and put it on the Ribbon. Here is the question:

    The same VBA code that I have used successfully in the custom form method with button (pasted into view code) does not work when creating the macro. How would I make the following code work as a macro?

    Sub StampDate()
    Item.Body = Date() & " - " & "JM Notes:" & vbCrLf & vbCrLf & vbCrLf & "ACTION: " & vbCrLf & "----------------------------------------------------------------" & vbCrLf & Item.Body
    End Sub

    I keep getting an error regarding the second line. Please help!

    • Diane Poremsky says

      You need a little more code to do it using VBA -

      Sub StampDate()
      Dim Item As Object

      Set Item = Application.ActiveInspector.CurrentItem
      Item.Body = Date & " - " & "JM Notes:" & vbCrLf & vbCrLf & vbCrLf & "ACTION: " & vbCrLf & "----------------------------------------------------------------" & vbCrLf & Item.Body

      Set Item = Nothing
      End Sub

  12. Obi Ejiofor says

    Dear Diane i need to configure adding a timestap automatically to an autoreply mail for a shared mailbox. We user outlook 2010 and exchange 2010 how would i script this in VBA ?

  13. Obi Ejiofor says

    We are using an autoreply rule. The user wants an time stamp added to each autoreply mail sent from the shared mailbox.

    • Diane Poremsky says

      That is not possible AFAIK. Sorry. You'd need to use a script, which would only work when the account was open in Outlook.

  14. GingaDave says

    Hi Diane

    I have a message template with a table in the body. is there a way of inserting the Datestamp in a specific cell?

    • Diane PoremskyDiane Poremsky says

      To the best of my knowledge, no, you can't insert it into a specific cell using VBSCript.

Leave a Reply

Please post long or more complicated questions at OutlookForums by

If the Post Comment button disappears, press your Tab key.