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

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

Advertise on the
WordTips Site

Newest Tips

Changing Tabs Using the Ruler

Moving Drawing Objects

Standardizing Note Reference Placement

Selecting Printing of Color Pictures

Stubborn Foreign Languages

Sizing the Preview Pane

Moving Rows and Columns With the Mouse

 

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

More Power! For some people, the prospect of creating Word macros can be scary. WordTips: The Macros can help you conquer your fears and you'll discover you're much more confident and productive as you make Word do exactly what you want. This is an invaluable source for learning macros. You are introduced to the topic in bite-sized chunks, pulled from past issues of WordTips. Learn at your own pace, exactly the way you want.
 
Check out WordTips: The Macros today!