WD2000: How to Automatically Open the Last Document Edited
This article was previously published under Q214206
This article has been archived. It is offered "as is" and will no longer be updated.
The bottom of the File menu lists the most recent files that you have saved or opened in chronological order (the last file that you saved or opened appears first). This list of files is commonly referred to as the "Most Recently Used (MRU)" list.
After you start Word, if you want to open the last file that you 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 by creating an AutoExec macro.
To automatically open the last document that you edited when you start Word, use one of the following methods.
Method 1: Create a Shortcut Containing a Command-Line Switch
- Right-click the Windows desktop, point to New on the menu that appears, and then click Shortcut.
- In the Create Shortcut dialog box, click Browse.
- Change the Look in box to the following folder:C:\Program Files\Microsoft Office\OfficeNOTE: Your installation of Microsoft Word may be in a different location.
- Click Winword.exe, and then click Open.
- In the Command line box, move the insertion point to the end of the text after the closing quotation mark.
- Type a space followed by /mfile1.The command line should now appear similar to the following example:C:\Program Files\Microsoft Office\Winword.exe /mfile1NOTE: There is no space between the /m and file1.
- Click Next.
- In the Select a name for the shortcut box, type what you want to call this shortcut, and then click Finish.
Method 2: Use an AutoExec MacroMicrosoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements.
For more information about how to use the sample code in this article, clickthe article number below to view the article in the Microsoft Knowledge Base:
212536 OFF2000: How to Run Sample Code from Knowledge Base ArticlesTo create a macro that will automatically open the last file that you edited when you start Word, follow these steps:
- On the Tools menu, point to Macro, and then click Macros.
- In the Macros dialog box, type AutoExec in the Macro Name box, and then click Create.
- In the Microsoft Visual Basic (macro editing) window, type the following macro:
Sub Autoexec() RecentFiles(1).OpenEnd Sub
- On the File menu, click Close and Return to Microsoft Word.
- Quit Microsoft Word.
NOTE: If you are prompted with the following message, click Yes.Changes have been made that affect the global template, Normal.dot. Do you want to save those changes?
For additional information about controlling how Word starts, click the article number below to view the article in the Microsoft Knowledge Base:
210565 WD: Word Startup (Command-Line) Switches and Their Purpose
switch start-up parameters arguments startup
Article ID: 214206 - Last Review: 12/05/2015 12:30:34 - Revision: 2.0
Microsoft Word 2000 Standard Edition
- kbnosurvey kbarchive kbinfo kbmacro KB214206