Results 1 to 7 of 7
  1. #1
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    PPT - MRU (Office97SR2)

    Darned if I can find a Word and Excel equivalent in PPT. Specifically, the PPT equivalent of:
    <pre> Application.RecentFiles.Item(1).Open
    </pre>

    seems to be missing.

    Word has it. Excel has it.

    I'd be grateful for any clues.

  2. #2
    Bronze Lounger
    Join Date
    Nov 2001
    Location
    Arlington, Virginia, USA
    Posts
    1,394
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Re: PPT - MRU (Office97SR2)

    I don't think the PowerPoint object model has the equivalent of the Word/Excel RecentFiles property or RecentFile object (if it does, they got it hid real well....) That would be too easy (& consistent); VBA programmers would become lazy & complacent if it were that easy. You'd probably have to retrieve this info from Registry. On my system (PPT 2K, WIN XP) the user MRU list for PowerPoint is found under the HKEY_CURRENT_USERSoftwareMicrosoftOffice9.0PowerPo intRecent File List key. Example values:

    File1 REG_SZ Cocuments and SettingsMarkDMy DocumentsPresentation2.ppt
    File2 REG_SZ Cocuments and SettingsMarkDMy DocumentsPresentation1.ppt

    Note that the MRU list is updated only upon exiting from PowerPoint. Once you retrieve the desired file name, you can use the Presentations Open method to open the presentaton (filename is first arg). If you're using Office 97 you'd have to check the HKEY_CURRENT_USERSoftwareMicrosoftOffice8.0PowerPo int key & subkeys to determine if same format is used for PPT 97 MRU values stored in Registry.

    HTH

  3. #3
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: PPT - MRU (Office97SR2)

    Mark thanks for the reply.

    > Office9.0PowerPointRecent File List key.

    Yup! I found that while traversing the reference to a MSKB article through the lounge.

    Of course, it applies as well for Excel.

    But not for Word or Access. At least, not in Win98/Office97SR2! How I LOVE my work!



    I'm actually looking to build generic code for Edit-Undo, akak "File, Close, No, File, 1", and the "1" isn't really correct. I should probably be using the FullName of the Active-{Presentation | Workbook | Document} doo-dad that I'm in:

    <pre>Public Sub EditUndoPowerPoint()
    Dim strObject As String
    strObject = ActivePresentation.FullName

    Application.ActivePresentation.Saved = True
    Application.ActiveWindow.Close
    End Sub
    </pre>


  4. #4
    Bronze Lounger
    Join Date
    Nov 2001
    Location
    Arlington, Virginia, USA
    Posts
    1,394
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Re: PPT - MRU (Office97SR2)

    Not sure what you're trying to do with the PPT file. As far as Registry MRU settings are concerned, as noted PPT & XL use same method. Word has the MRU list buried in a large binary value found under this key:

    HKEY_CURRENT_USERSoftwareMicrosoftOffice9.0WordDat a

    The "Settings" binary value stores the MRU list amongst many other settings. Access MRU list is stored as individual string values under:

    HKEY_CURRENT_USERSoftwareMicrosoftOffice9.0AccessS ettings

    There are nine string values named MRU1, MRU2, etc under the Settings key that store the file names. There are also nine DWORD values named MRUFlags1, etc thru MRUFlags9. On my system all of these are set to zero (0). Not sure what purpose they serve (in Access Options I currently have "Recently used file list" set to 4, not 9....). Don't know if Office 97 uses same format for the Word & Access MRU's. Only thing clear is that MS Office apps obviously don't have a consistent method for storing & retrieving the MRU list.

    HTH

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: PPT - MRU (Office97SR2)

    It's different for each of the major Office applications:
    For Access: HKEY_CURRENT_USERSoftwareMicrosoftOfficen.0AccessS ettings, values MRU1, MRU2 etc.
    For Excel: HKEY_CURRENT_USERSoftwareMicrosoftOfficen.0ExcelRe cent Files, values File1, File2 etc.
    For PowerPoint: HKEY_CURRENT_USERSoftwareMicrosoftOfficen.0PowerPo intRecent File List, values File1, File2 etc.
    For Word: HKEY_CURRENT_USERSoftwareMicrosoftOfficen.0WordDat a, in Settings, a binary value.

  6. #6
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: PPT - MRU (Office97SR2)

    > Not sure what you're trying to do with the PPT file.

    The same thing I do with Word and Excel files : implement a faster Edit-Undo. I save my work whenever I've made a major changes that is successful, and just before I make a change that is experimental. That way I can undo the experiment by choosing File-Close-No, File-1. The trouble is that the most recent file ("1") isn't necessarily the file on which I'm working, so an Edit-Undo macro makes use of ther string file name. I thought of that late last night AFTER I'd posted the initial enquiry.

    About three years ago I wrote a Class object example for INI files that permitted multiple keys within a section (and multiple sections within a file), and embarked on a "better" MRU system. Sometimes, opening a file through Explorer doesn't seem to load the MRU registry keys, so I figured on an event that would store values in an INi file.

    I could then work my way through a series of MRUs by using a .Next method on my object, as in:
    <pre> With IniSection
    While Not .EOF
    strMRUFile=.Next
    Wend
    End With
    </pre>


    The impetus for this latest venture came from a recent Excel/macros/toolbar class where we disovered that running some simple macros (cell formatting) resulted in the edit-undo buffer being not-set; the "Undo" toolbar button was greyed-out. So, use the File-Close-No-File-1 method and, why not put THAT in a handy toolbar macro?

  7. #7
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: PPT - MRU (Office97SR2)

    > It's different for each of the major Office applications:

    Hans, thanks for these references; I'll file them for future use!

    As I noted in my reply to Mark, the MRU list fails me in not always reporting files that were opened.

    Another failure from my point of view is the limitation on "9" MRU files.

    I started by recording a macro to File-Close-No-File-1, through the RecentFiles, and that finally led me to believe that for my edit-undo purposes, the MRU was not what I needed after all.

    I learned something again, today!

Posting Permissions

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