Please Note: This article is written for users of the following Microsoft Word versions: 97, 2000, 2002, and 2003. If you are using a later version (Word 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Word, click here: Setting a Document Naming Convention.

Setting a Document Naming Convention

by Allen Wyatt
(last updated February 27, 2017)

5

Michelle is a solo lawyer trying to develop a paperless office. One important factor is a document naming convention to help her organize and locate documents. Michelle would like to save all documents starting with the date YYYY_MM_DD to which she would add relevant client information. She wonders if there is a way to create a default for Word so that when she saves a new document, it automatically starts with the current date.

There are a few approaches you can take to handle this problem. Most of the solutions involve using a macro in one way or another. Perhaps the easiest macro-based approach is to make some modifications to the FileSaveAs command. This is the command that Word executes whenever you choose Save As (pressing F12 is the easiest way to do this) or whenever you click the Save button on the toolbar with a brand new document.

Public Sub FileSaveAs()
    Dim dlgSave As Dialog

    Set dlgSave = Dialogs(wdDialogFileSaveAs)

    With dlgSave
        .Name = Format(Date, "yyyy_mm_dd ")
        .Show
    End With
End Sub

This macro is quite simple in concept: It simply puts the current date (in the desired format) into the Save dialog box and then shows the dialog box. In this way, the person can then add whatever "relevant client information" is desired after that date.

Another approach to put the current date into the Save As dialog box is to rely on the fact that Word, by default, uses the contents of the Title field in the document properties as the default filename. You can use fields to update the contents of the Title field. This means that you can follow these general steps:

  1. Create a brand new template for your documents. (You can use the Normal template, if desired.)
  2. Put the following field inside your document: { info title "{ DATE \@ "yyyy_MM_dd" }" }
  3. Bookmark the entire nested field and use a bookmark name such as "infotitle".
  4. Create a macro such as the following:
  5. Public Sub AutoNew()
        Application.ScreenUpdating = False
        ActiveDocument.Bookmarks("infotitle").Range.Fields.Update
        ActiveDocument.Bookmarks("infotitle").Range.Delete
        Application.ScreenUpdating = True
    End Sub
    
  6. Save your template.

Remember that in perform step 2, the way you insert field braces is to press Ctrl+F9. The field (which is updated in the AutoNew macro) fetches the current date, in the format specified, and places it into the Title field of the document properties. The macro, after updating the field (and thereby setting the Title field), then deletes the field from the document itself.

The result is that when someone goes to save the document for the first time, Word grabs the contents of the Title field and uses it as the suggested filename for the document. The user can then add whatever "relevant client information" is desired after the date.

Additional thoughts on this topic of setting a standard file name can be found at this tip:

http://word.tips.net/T003531

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (11617) applies to Microsoft Word 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Word (Word 2007 and later) here: Setting a Document Naming Convention.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He  is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Adding a Comment to Multiple Cells

Adding a comment to a single cell is easy. What if you want to add the same comment to multiple cells, however? Here are some ...

Discover More

Understanding Custom Chart Templates

Excel allows you to create custom chart formats that go beyond the standard formats provided in the program. These custom ...

Discover More

Working with E-mailed Documents

Ding! You've got mail. That mail has a Word document attached to it. Before you rush off and open that document, take a ...

Discover More

Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!

More WordTips (menu)

Saving Your Work Automatically

Word can be configured to save your work periodically, on any time schedule you desire. This tip explains this feature and ...

Discover More

Positioning the Cursor in a New Document

Creating special templates is a great way to establish "standards" for your documents. With a little ingenuity you can even ...

Discover More

Using a Standard Format in a Suggested File Name

Many companies (and some individuals) use specific formats for naming their documents. If you want Word to recognize your ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 4 - 3?

2016-04-29 11:53:39

Alexa

Thank you so much!!! You made my day!!!


2015-09-19 19:45:42

Margaret

Thank you Allen for the tip. Our office is seeking new ways to standardize our file naming schemes.

To Lynn Barto's comment
1. Ideas are not stupid; stupidity is a reflection upon one's self.
2. Date modified is not a reliable format for your documents as this date will change depending on how you view/handle it in your programs.


2013-07-01 13:56:16

Andrew

Thank you for the insight, but I wonder, would it be possible to enforce a naming convention on a new document based on the values of specific form fields in the active document mixed with some standardized text that I designate.

Such As the name of the document would include a designation for the type of report it is and have a section of text that is dependent on a particular office site selected from a drop down in the document. In the document the full name of the site is displayed but the drop down value is set to a standard abbreviation that I would like to include in the naming convention to further segregate files when saved along with the current date in mm-dd-yy format.

So a file name would look something like:

TPS AAB mm-dd-yy.docx
type site date.extension

Any thoughts?


2013-05-09 09:35:54

Lynn Barto

Putting the date first when naming a document is STUPID. Period. End of Story. When you open a directory you have a column that says, "DATE MODIFIED". When you have 100 documents in a Correspondence Folder and your boss tells you to "Find the letter we did to Smith sometime last year.", it is WAY MORE SIMPLE to find the name ALPHABETICALLY until you are a telepath and can remember THE EXACT month and day you created a document. Let's see, Smith.. there is is! And you can organize your 100 documents by DATE with a click of a button... whether you have the date first or NOT!


2013-04-10 11:33:53

Paul Dalton

Allen. I'm sure I must have done something wrong, I just don't know what it is.

I copied and used your SaveAs macro and it worked fine. Starting a couple of days ago, when I try to use it, I now get an error message of "Compile Error. Wrong number or arguments or invalid property assignment." And when I click on "OK", I'm taken to the VBA edit screen, where the name of the macro is highlighted in yellow (with a yellow arrow to the left of it) and the word "Format" on the 4th line is highlighted in blue.

Any ideas/suggestions for getting this macro to work correctly again?

Thanks,
Paul


This Site

Got a version of Word that uses the menu interface (Word 97, Word 2000, Word 2002, or Word 2003)? This site is for you! If you use a later version of Word, visit our WordTips site focusing on the ribbon interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.