WD: How to Open the Last Document Edited When You Start Word

Last reviewed: February 11, 1998
Article ID: Q97790

The information in this article applies to:
  • Microsoft Word 97 for Windows
  • Microsoft Word for Windows 95, versions 7.0, 7.0a
  • Microsoft Word for Windows, versions 6.0, 6.0a, 6.0c
  • Microsoft Word for Windows, versions 2.0, 2.0a, 2.0a-CD, 2.0b, 2.0c
  • Microsoft Word for Windows, versions 1.0, 1.1, 1.1a

SUMMARY

The bottom of the File menu in Microsoft Word for Windows lists the last files that have been saved or loaded in chronological order (the last file saved or opened appears first). This list of files is commonly referred to as the Most Recently Used (MRU) list.

After you start Word for Windows, if you want to open the last file saved or opened, you can manually click the first file listed on the MRU list on the File menu, or you can have Word automatically open the file when you start Word by either modifying the Word command line or creating an AutoExec macro.

MORE INFORMATION

To automatically open the last document edited in Word for Windows when you launch the Word program, use one of the following methods:

Method 1: Use the "/mFile1" Switch on the Command Line

Windows 95

  1. With the right mouse button, click the Start button, and then click Explore.

  2. In Explorer, expand the Windows folder by clicking the plus (+) sign to the left of the Windows folder. Expand the Start Menu folder, and then click the Programs folder.

  3. In the Programs folder, right-click the shortcut for Microsoft Word, and then click Properties.

  4. In the Properties dialog box, select the Shortcut tab. Add "/mFile1" (without the quotation marks) to the Target line. For example, if you are using the default Word 97 folder, change the Target line so that it looks like this:

          C:\Program Files\Microsoft Office\Winword.exe /mFile1
    

    NOTE: There is no space between the /m and File1.

Windows 3.1

  1. Select the Word for Windows icon in Windows Program Manager.

  2. On the Program Manager File menu, click Properties.

  3. Add "/mFile1" (without quotation marks) to the command line. For example, if your Word for Windows directory is on drive C and is called Winword, change the command line to the following:

          C:\Winword\Winword.exe /mFile1
    

    NOTE: There is no space between the /m and File1.

The File1 macro opens the first file in the list of most recently saved documents.

Method 2: Use an AutoExec Macro

Word 97

  1. On the Tools menu, point to Macro, and then click Macros.

  2. In the Macros dialog box, type "AutoExec" (without the quotation marks) in the Macro Name box, and then click Create.

  3. In the macro editing window, create the following macro:

          Sub Autoexec()
             RecentFiles(1).Open
          End Sub
    
    

  4. On the File menu, click Close and Return to Microsoft Word.

Word 6.0/7.0

  1. On the Tools menu, click Macro. In the Macros Available In list box, select Normal.dot (Global Template) and in the Macro Name box, type "AutoExec" (without the quotation marks). Click the Create button.

  2. Below the Sub Main statement, type "File1" (without the quotation marks), as in the following example:

          Sub Main
             File1
          End Sub
    
    

  3. On the File menu, click Close and, when prompted, choose to save changes to the Global:AutoExec macro.

  4. On the File menu, click Save All and, if prompted, choose to save global changes to the Normal.dot template.

Word 2.x

  1. On the Tools menu, click Macro. In the Show box, select Global Macros, and in the Macro Name box, type "AutoExec" (without the quotation marks). Click Edit.

  2. Below the Sub Main statement, type "File1" (without the quotation marks), as in the following example:

          Sub Main
             File1
          End Sub
    
    

  3. On the File menu, click Close and, when prompted, choose to save changes to the Global:AutoExec macro.

  4. On the File menu, click Save All and, when prompted, choose to save global glossary and command changes.

Word 1.x

  1. On the Macro menu, click Edit. In the context box, select Global. In the Edit Macro Name box, type "AutoExec" (without quotation marks). Click OK.

  2. On the blank line after Sub Main, type "File1" (without quotation marks).

  3. On the File menu, click Close and, when prompted, choose to save changes to the Global:AutoExec macro.

  4. On the File menu, click Save All and, when prompted, choose to save global glossary and command changes.

REFERENCES

"Microsoft Word for Windows Getting Started," version 2.0, page 14

"Microsoft Word for Windows User's Reference," version 1.x, page 337


Additional query words: switch start-up parameters arguments startup
Keywords : winword winword2 word6 word7 word8 word95 word97 wordnt word word98 kbmacro kbusage
Version : 1.x 2.x 6.0 6.0a 6.0c 7.0 7.0a 97
Platform : WINDOWS


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: February 11, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.