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

Written by Allen Wyatt (last updated June 26, 2018)
This tip applies to Word 97, 2000, 2002, and 2003


1

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

Note:

If you would like to know how to use the macros described on this page (or on any other page on the WordTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

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

Defining Shortcut Keys for Symbols

Do you need to use symbols frequently in your Excel data? The common way to insert them is by using the Symbol dialog ...

Discover More

Using Drag-and-Drop to Create a Hyperlink

If you open workbooks in two instances of Excel, you can use drag-and-drop techniques to create hyperlinks from one ...

Discover More

Determining the Complexity of a Worksheet

If you have multiple worksheets that each provide different ways to arrive at the same results, you may be wondering how ...

Discover More

Do More in Less Time! Are you ready to harness the full power of Word 2013 to create professional documents? In this comprehensive guide you'll learn the skills and techniques for efficiently building the documents you need for your professional and your personal life. Check out Word 2013 In Depth today!

More WordTips (menu)

Read-Only Files

Read-only documents (those that cannot be updated) are part and parcel of working with Word. There are many ways that a ...

Discover More

Avoiding the Update Links Message

Word allows you to establish links from one document to another. When you open a document containing these links, you may ...

Discover More

Getting Rid of the Startup Document

When you start Word, it opens a blank document, ready for you to start typing within. If you don't want this blank ...

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}] (all 7 characters, in the sequence shown) 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 two less than 9?

2018-01-08 19:06:19

Terry

I am definitely not a programmer but was able to recreate the above macro in my Word document, and it worked just fine. Thank you very much. But now, is there a way to add some of the document properties to your code line, ".Name = Format(Date, "yyyy_mm_dd ")", such as the revision number (in Statics) or any of the custom properties?


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.

Videos
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.