Word.Tips.Net Welcome toWord.Tips.Net

Helpful Links

Tips.Net Home
WordTips Home

Ask a Word Question
Make a Comment

Tips.Net Store

WordTips FAQ
WordTips Premium

Learn Access Now
Free Printable Forms

Beauty Tips
Car Tips
Cleaning Tips
College Tips
Cooking Tips
Excel2007 Tips
ExcelTips
Family Tips
Gardening Tips
Health Tips
Home Tips
Legal Tips
Money Tips
Organizing Tips
Pest Tips
Pet Tips
Wedding Tips
Word2007 Tips
WordTips

Advertise on the
WordTips Site

Newest Tips

Printing On Both Sides of the Paper

Turning Off AutoComplete for Dates

Ordering Search and Replace

Understanding Auto Line Spacing

Adding Comments to Your Document

Conditional Calculations in Word

Determining Word Frequency

 

Grabbing the MRU List

Summary: The MRU (most recently used) list informs you which documents were the last to be opened and edited in Word. You can access the list in a macro by using the RecentFiles collection, as illustrated in this tip. (This tip works with Microsoft Word 97, Word 2000, Word 2002, Word 2003, and Word 2007.)

Word allows you to maintain a list of the most-recently used (MRU) files. This list can record the names of the most recently opened and edited within Word. You can see the MRU list by clicking the Office button (in Word 2007) or at the bottom of the File menu (in previous Word versions).

If you want to grab the names of the MRU files and insert those names in a document, you can use the following VBA macro:

Sub MostRecent()
    Dim J As Integer

    For J = 1 To RecentFiles.Count
        Selection.TypeText Text:=RecentFiles(J).Name
        Selection.TypeParagraph
    Next J
End Sub

Tip #1457 applies to Microsoft Word versions: 97 | 2000 | 2002 | 2003 | 2007

Add a Professional Finishing Touch! Word includes great tools that allow you to add professional-grade finishing touches to your documents. You can add indexes, tables of contents, and other special tables by using the detailed information available in this volume.
 
Check out WordTips: Indexes and Special Tables today!