Results 1 to 11 of 11

Thread: Addtorecentfiles trouble

  1. #1

    Thread Starter
    Frenzied Member zaza's Avatar
    Join Date
    Apr 2001
    Location
    Borneo Rainforest Habits: Scratching
    Posts
    1,486

    Resolved Addtorecentfiles trouble

    Hi,

    More specifically, I was wondering if there are any options which need to be set so that the Addtorecentfiles parameter of the Documents.Open method works, or any activities which stop it from working. I find that the file I want not to appear in the Recent Files list persists in doing so. I've checked all my uses of Documents.Open, and this parameter is always set False. Also, just in case it does something different should the file already be named in the list, I've opened lots of Word documents to get it out of the Recent files list, then tried my code again and it just puts the file back on the list again.

    Any ideas?

    Cheers

    zaza
    Last edited by zaza; Jun 1st, 2005 at 01:52 PM.

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Addtorecentfiles trouble

    The recent files list stores in three places:
    C:\Documents and Settings\VB-Guru\Recent
    C:\Documents and Settings\VB-Guru\Application Data\Microsoft\Office\Recent
    Also, a section in the Registry. I forgot where but I had assisted in a thread on it before so amy a search would show it location.
    Try clearing out your files and testing again. It could be that its being added from the cache.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  3. #3
    Frenzied Member sciguyryan's Avatar
    Join Date
    Sep 2003
    Location
    Wales
    Posts
    1,763

    Re: Addtorecentfiles trouble

    Quote Originally Posted by RobDog888
    The recent files list stores in three places:
    C:\Documents and Settings\VB-Guru\Recent
    C:\Documents and Settings\VB-Guru\Application Data\Microsoft\Office\Recent
    Also, a section in the Registry. I forgot where but I had assisted in a thread on it before so amy a search would show it location.
    Try clearing out your files and testing again. It could be that its being added from the cache.

    What about setting the 4th parameter of the Documents.Open to False, would that not work?

    VB Code:
    1. Dim objExample As Object
    2. objExample = Documents.Open(FileName:="D:\MS Office\My Documents\Other\Complete Idiots Guide To DVD Remote.doc", AddToRecentFiles:=False)

    Cheers,

    RyanJ
    Last edited by sciguyryan; May 31st, 2005 at 03:53 PM.
    My Blog.

    Ryan Jones.

  4. #4
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Addtorecentfiles trouble

    Zaza is already doing that. Maybe there is something else going on?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  5. #5
    Frenzied Member sciguyryan's Avatar
    Join Date
    Sep 2003
    Location
    Wales
    Posts
    1,763

    Re: Addtorecentfiles trouble

    Quote Originally Posted by RobDog888
    Zaza is already doing that. Maybe there is something else going on?

    OOps, sorry I did not see that bit....


    Cheers,

    RyanJ
    My Blog.

    Ryan Jones.

  6. #6
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Addtorecentfiles trouble

    No need to apologize, just was pointing it out hoping to help narrow it down to the issue.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  7. #7
    Frenzied Member sciguyryan's Avatar
    Join Date
    Sep 2003
    Location
    Wales
    Posts
    1,763

    Re: Addtorecentfiles trouble

    Quote Originally Posted by RobDog888
    No need to apologize, just was pointing it out hoping to help narrow it down to the issue.

    Like you said deleting the entry from the recent documents list would do the trick if you cannot fix this problem

    And I checked in the registry and I cannot seem to find a place where they are stored, maybe they are not stored in the registry after all

    Cheers,

    RyanJ
    My Blog.

    Ryan Jones.

  8. #8
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Addtorecentfiles trouble

    I found it. It was in the General Developers Forum.

    Recent Files Locations
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  9. #9
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Addtorecentfiles trouble

    if you saveas it can also addtorecentfiles

    also to remove
    RecentFiles(2).Delete


    pete

  10. #10

    Thread Starter
    Frenzied Member zaza's Avatar
    Join Date
    Apr 2001
    Location
    Borneo Rainforest Habits: Scratching
    Posts
    1,486

    Re: Addtorecentfiles trouble

    Hi,

    Aha, nice work westconn1. Actually, I wasn't using saveas. I was, however, including a sneaky Save option in the "Close" method - it was this that was causing it to be added to the files list. Solution: save it first using SaveAs with Addtorecentfiles set to false, then close it without saving.

    Job done. Nice one.

    zaza

  11. #11
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Addtorecentfiles trouble

    any save method that uses options is really saveAs

    pete

Posting Permissions

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



Click Here to Expand Forum to Full Width