How to automatically add the date or time to the subject of an Outlook e-mail message

If the Microsoft Outlook forms do not get the job done, follow the steps in this tutorial to create a custom form.

Image: iStockphoto.com/cosmin4000

In Microsoft Outlook you cannot change the standard message form, but you can create a custom form and use it instead. After you’ve added the custom form, you can add it to the ribbon and still have the same one-click email you have now. The disadvantage is that you have to jump through a few hoops – although there are many steps, the process is not complicated.

To automate the date, create and publish a custom form that automatically adds the date to the subject line of the new e-mail message. You then write a procedure (macro) that opens the form. Finally, add a new group to the Home tab that allows you to open the form with one quick click. The purpose of the article is to show you how to implement a custom form, so the form itself is simple. Later you want to explore all options so that you can create forms that allow you to work more efficiently.

I use Office 365 on a Windows 10 64-bit system. You can create custom forms in earlier versions, but the instructions may vary. This solution is code based, so it is not suitable for Mail (online version). You can import the downloadable .cls file instead of recreating the procedure used.

MORE INFORMATION: Office 365 Consumer prices and functions

How to design the custom form in Outlook

All custom forms are based on standard forms that contain the same functionality as the default values; you can hide, add and even add a script to automate them. In this case we only add the date to the subject. To start, you must create (design) a custom form by following these steps.

  1. Click the Developers tab, and then click Choose Form in the Custom Forms group. If the Developers tab is not enabled, click the File tab and choose Options in the left pane. Then choose Customize Ribbon. Select Developer from the Main Tabs list on the right, and then click OK.
  2. Choose in the dialog that appearsFigure A) in the library of standard forms (the standard) and then click OK.
  3. In the new e-mail window, click the Developers tab. Then click Design this form in the Form group. This opens the standard form in edit mode.
  4. Click in the Subject box, and then click Property Sheet in the Tools group.
  5. In the dialog that appears, click the Value tab.
  6. Select the Initial value of this field check box, and then enter Date in the control just below (Figure B). The standard calculation method is the one we want. (Enter the time if you want to display the time.)
  7. Click OK.

Figure A

Choose the standard form for messages.

Figure B

You can click Run this form in the Form group to confirm the addition if you want. Figure C shows a very familiar e-mail window with the current date in the subject. Click the Developers tab to return to the custom form in edit mode – if you click the Close button, you will lose your work. You can skip this step if you want, but it’s a good idea to check your work. We have also not examined any of the features – come back later and take a look around.

Figure C

Run the form to check the addition.

Publish the form

As it is, the form is not available to you or anyone else – you must publish the form to make it available. To do this, click Publish in the Form group, and then choose Publish Form As from the drop-down list. (The Publish Form and Publish Form as options work the same way as the Save and Save As commands.) By default, Outlook uses the personal forms library and that is what we will use. If you want the form to be available to other users, publish the form in a public folder, which we will not cover in this article. When sharing, only users who have permission for the public folder can access the custom form. In the dialog box that appears, enter a name for the form (Figure D). Before continuing, note the (internal) name of the form at the bottom of the form: IPM.Note.DateInSubject – you will need this later. Click Publish, close edit mode, and click Yes if you are prompted to save your work.

Figure D

Use the custom form

After you have made every effort to create a custom form to work more efficiently, you may think it would be easy to use, but that is not the case – at least not initially. At this time, the only way to use the form is the hard way: In the Mail window, click New Items in the New group (on the Home tab), and then choose More Items from the drop-down list. Then select Choose form in the resulting submenu (Figure E). In the dialog box that appears, choose the correct library in the Search in dialog box; in this case you want the personal forms library. Select DateinSubject (Figure F) and click Open. Finally, there is your e-mail window with the date in the subject. This is of course much more labor-intensive than just entering the date itself! You want a form with one click.

Figure E

The route to the modified form is a bit long.

Figure F

Choose the custom form.

The good news is that you can add a custom form with one click; create a macro that opens the form and add the macro to the ribbon. To do this, press Alt + F11 to open the Visual Basic Editor (VBE) and enter the procedure in List A for the ThisOutlookSession module. Do not attempt to copy the code from this webpage. Enter it manually or import the demonstration ThisOutlookSession.cls module. Save and close the module to return to Outlook.

List A

Public Sub OpenDateEmailForm

Dim items such as Outlook. Items

Dim item as object

Set Items = Application.ActiveExplorer.CurrentFolder.Items

Set Item = Items.Add (“IPM.Note.DateInSubject”)

Item.Display

End of Sub

You probably want the DateInSubject option next to the New Email option in the New group on the Home tab – that’s where I want it. If yes, follow these steps.

  1. Click on the File tab and choose Options. In the left pane, choose Customize Ribbon.
  2. Choose Macros in the Choose commands from the drop-down list.
  3. Select OpenDateInSubject in the left list.
  4. On the right, click New under Home Page and then New Group.
  5. Rename the New Item group Date by clicking Rename (with the new group selected) and enter the name in the Display Name control in the Rename Name dialog box (Figure G).
  6. Click OK.
  7. Select New item date (modified) still, select the OpenDateInSubject macro in the left list and click Add (Figure H).
  8. Right-click the macro and choose Rename. In the dialog box that appears, enter the date of the new item and click OK. If you skip this step, Outlook displays the full macro name.
  9. Click OK to return to Outlook, where you will see a new group: Date new item (Figure I).

Figure G

Figure H

Add the macro to the new custom group.

Figure I

The new group displays the macro that you created to open the new custom form.

Click New Item Date in the New Item Date group to open the form. That is it! (If prompted to enable macros, do so.) You cannot delete the default new e-mail from the ribbon, but you can place the custom group that you created before the existing new group.

Send me your question about Microsoft Office

I answer questions from readers when I can, but there is no guarantee. Do not send files unless requested; initial requests for help arriving with attached files are deleted unread. You can send screen shots of your data to clarify your question. Be as specific as possible when contacting me. For example: “Solve problems with my workbook and solve the problem” will probably not get an answer, but “Can you tell me why this formula does not produce the expected results?” power. State the app and version that you are using. I do not receive any reimbursement from TechRepublic for my time or expertise in helping readers, nor do I request reimbursement from readers who I help. You can contact me via [email protected].

Weekly newsletter from Microsoft

Be Microsoft’s insider for your business with the help of these Windows and Office tutorials and the analyzes of our experts on Microsoft business products.
Delivered on Monday and Wednesday

Register today

Also see

Disclosure of affiliated parties: TechRepublic can earn a commission with the products and services on this page.

Follow AsumeTech on

More From Category

More Stories Today

Leave a Reply