Results 1 to 8 of 8
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Marietta, Georgia, USA
    Posts
    296
    Thanks
    9
    Thanked 4 Times in 4 Posts

    Word Hacks not working

    I'm trying to enhance the Most Recently Used (MRU) list in Microsoft Word 2003. I want to have multiple MRU lists, each with more than the limit of 14 entries. I bought the Word Hacks book a few days ago and downloaded the code:
    http://examples.oreilly.com/9780596004934/

    It appears that the code for Hack #13 only "kinda-sorta" works (10% of the time). I have tried this under both Windows 7 and Windows XP. The main problem is that it almost never adds new files to the INI-based MRU list.

    I have spent a few hours studying the code, and googling for similar ideas. It appears that one culprit is using System.PrivateProfileString - apparently not reliable in VBA.

    Has anyone else successfully used this Hack? Or does anyone know of a similar solution that works?
    Last edited by rgrosz; 2015-02-09 at 17:36.
    Rick Groszkiewicz
    Life is too short to drink bad wine (or bad coffee!)

  2. #2
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Marietta, Georgia, USA
    Posts
    296
    Thanks
    9
    Thanked 4 Times in 4 Posts
    The other problem is the assumption there are 25 documents in the MRU list. I start with only two files in my INI, similar to the example in the book. But there is no mechanism to instantiate a new member of the MRU Class when new documents are opened - nothing in the code to add new files to the MRU list.
    Rick Groszkiewicz
    Life is too short to drink bad wine (or bad coffee!)

  3. #3
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts
    I don't have the book and so I'm not sure what you actually want multiple MRU lists to achieve for you. I would have thought that it would be more useful to revisit this with the ribbon of Word 2007+ in mind. Are you really trying to develop a working solution for Word 2003?

    The author of that book was active on this forum's ancestor while he was writing it so some of the code included there had its genesis here and a search might reveal relevant information that can flesh out the missing elements.
    Last edited by Andrew Lockton; 2015-02-10 at 01:31.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  4. #4
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Marietta, Georgia, USA
    Posts
    296
    Thanks
    9
    Thanked 4 Times in 4 Posts
    I'm helping out a friend who normally edits 15+ related Word documents for a given project. And they work on multiple projects each day.

    We are both users of Word 2003, with no plans to upgrade to Word 2007. She just upgraded to Word 2003 last year.

    Prior to posting the message, I did searches here (and many other places) for Microsoft Office and MRU lists. Did not find much that was helpful to me.
    Rick Groszkiewicz
    Life is too short to drink bad wine (or bad coffee!)

  5. #5
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts
    So what is your plan for how it would work from the users point of view? Do you want a way of categorising MRU files or do you want to define which list is currently active. How do you plan to switch lists on the fly if opening Word with a document that is in a different project?

    Have you considered the Work menu? This is on a similar principle but the user decides which files to add rather than letting Word increment it.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  6. #6
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Marietta, Georgia, USA
    Posts
    296
    Thanks
    9
    Thanked 4 Times in 4 Posts
    Quote Originally Posted by Andrew Lockton View Post
    So what is your plan for how it would work from the users point of view? Do you want a way of categorising MRU files or do you want to define which list is currently active. How do you plan to switch lists on the fly if opening Word with a document that is in a different project?

    Have you considered the Work menu? This is on a similar principle but the user decides which files to add rather than letting Word increment it.
    I will add a drop-down list on the initial user form, so she can select which "work project" to start. Then the form will show the MRU list for that project. I'll add a command button so she can open files that are not on the list, then add them to the MRU list.

    I took a look at the Work menu, which has seems too klunky to me:
    http://word.mvps.org/FAQs/General/WorkMenu.htm
    Rick Groszkiewicz
    Life is too short to drink bad wine (or bad coffee!)

  7. #7
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts
    Now we see the first mention that you are using a userform.

    So is the question now - how do I populate a listbox from a text file? Or is it how do I read and write a text file in vba?
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  8. #8
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Marietta, Georgia, USA
    Posts
    296
    Thanks
    9
    Thanked 4 Times in 4 Posts
    Andrew, the example project from the Word Hacks book already has the user form, plus the logic for reading and writing the INI file (which has the file names). My intention is to modify the existing code so it works properly.
    Attached Images Attached Images
    Rick Groszkiewicz
    Life is too short to drink bad wine (or bad coffee!)

Posting Permissions

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