Consulting

Results 1 to 8 of 8

Thread: "Recent Documents" list in Word 2007/2010

  1. #1

    "Recent Documents" list in Word 2007/2010

    Is there a programmatic way to access the "Recent Documents" list? I have tried sending keystrokes via the user interface. Since Alt + F activates the Office button/File ribbon, then...

    SendKeys "%f"
    SendKeys "{right}"

    But when I assign the macro to Alt + D(which is how I want this to work), the hotkey Alt + the SendKeys Alt conflict. I have also tried

    SendKeys "{F10}" ' an alternative way to focus the ribbon
    SendKeys "f"
    SendKeys "{right}"

    But the hotkey Alt causes the SendKeys statement to send Alt + F10, which by default is AppMaximize. I disabled Alt + F10, but still no luck.

    Since the quick-and-dirty solutions are not working, I am hoping to find a more elegant and direct way to access the list of recent documents, and assign it to Alt + D.

  2. #2
    VBAX Expert Tinbendr's Avatar
    Joined
    Jun 2005
    Location
    North Central Mississippi (The Pines)
    Posts
    993
    Location
    [VBA]Sub RecentFiles()
    Dim Rnt As String
    For Each Rcnt In Application.RecentFiles
    Debug.Print Rcnt
    Next

    End Sub

    [/VBA]

    David

  3. #3
    Thanks for this, David. I can see that your code processes all of the documents in the Application.RecentFiles collection, but the list of documents is not displayed, so a document cannot be chosen.

  4. #4
    VBAX Expert Tinbendr's Avatar
    Joined
    Jun 2005
    Location
    North Central Mississippi (The Pines)
    Posts
    993
    Location
    Ok, you need a builtin dialog, maybe.

    I'm not good at manipulating the menu through sendkeys.

    Maybe someone else can pipe in.

    David


  5. #5
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,724
    Location
    If you just want to pick a file from the MRU, I'd read them into a list box and pick it

    It's easy enough to mod if you just want the open ones

    Out of courousity, what are you trying to do?

    Paul
    Attached Files Attached Files

  6. #6
    Not exactly. I want to produce the same list of documents that appears in "Recent Documents," i.e., the list that allows a user to scroll through the list of recent documents, and choose one to open.

    The "ideal" solution would be to give direct access to the list of Recent Documents: that's the list that is to the right when you click (or otherwise give focus) to the Office button.

    Background: One of my clients is blind, and accesses a computer via a screen reader. In Word 2003, I added "&Documents" as a top-level menu. This custom menu contained only the list of recently opened documents. (I constructed it by making a copy of the "File" menu, and deleting everything from it except the list of recent documents.)

    Now, my client is migrating to Word 2010. Screen reader access to ribbons is more complicated than screen reader access to menus, and he asks that that keyboard interaction with Word 2010 be as similar as practical to what he is used to.

  7. #7
    Another way to put this:

    Is there a way to display only the list of Recent Documents, with its "pin" buttons, that normally appears to the right of the Office button/File ribbon?

  8. #8
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,724
    Location
    In 2010

    [VBA]
    SendKeys ("%fr")

    SendKeys ("%fr2")

    [/VBA]

    the first will activate the MRU and the second will open the second document

    I don't know if the speech / reader will work, but the menus open

    Paul

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •