none
Word AddToRecentFiles no effect RRS feed

  • Question

  • when using the following code written in VB.NET:

      Sub main()
            Dim wordApp As New Word.Application
            Dim wordDoc As Word.Document = wordApp.Documents.Add()
            wordDoc.SaveAs(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) & "\Export_lirumLarum.doc", AddToRecentFiles:=False)
            wordApp = Nothing
        End Sub

    I would expect that the file "Export_lirumLarum.docx" is nether in the "Recent" list that is displayed if I rightclick the Word icon nor in the list that is displayed by Word itself.

    But its present in both lists.

    I'm currently using a comibnation of Windows 7 and Word2007. Is there a way to resolve this problem? I allready tryed several things, at least the list that is displayed if I rightclick the icon in the taskbar is nerver effected.

    I tryed the following stuff:

    delete the reference to the file in \Microsoft\Office\Recent

    delete the reference to the file in \Microsoft\Windows\Recent

    delete the recent file over the WordApplication.RecentFiles list

    delete the registry-entrys that contain the Filename in the Software\...\Word-section.

    combine all approachs


    • Edited by Aeglasin Thursday, March 12, 2015 9:43 AM
    • Moved by CoolDadTx Thursday, March 12, 2015 5:17 PM Office related
    Thursday, March 12, 2015 9:42 AM

Answers

  • Hi Aeglasin,

    >> I would expect that the file "Export_lirumLarum.docx" is nether in the "Recent" list that is displayed if I rightclick the Word icon nor in the list that is displayed by Word itself.

    I have made a test with your code, and I could not reproduce your issue. For the file list in the recent file in the word open page, I would recommend you remove the file in this page before you test the code, or you could edit the "Export_lirumLarum.doc" to a new name. For the file displayed if you right click on the Word icon, it could not be achieved with the code. If you want the icon do not show the recent file, for a workaround,you could do as picture below:

    TempFile.gif

    In addition, to check whether the file is added to the recent files, I think you could bebug the code step by step.

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Monday, March 16, 2015 12:51 PM

All replies

  • Hello Aeglasin,

    Make sure that you have all the latest updates and service packs installed for Office 2007.

    See How to edit the Windows registry to clear the list of most recently used files in Office .

    Thursday, March 12, 2015 6:38 PM
  • The updates are automatically installed thanks to our company's security-software.

    I think I need to clarify:

    the MRU IN word it self, so the list that is displayed when you check the most-recent-file list that is displayed when press the Office-symbol, is cleared.

    My current problem is the recent documents that apear when you right click the word icon on the windows taskbar. Here are references to the old files that i allready deleted, the only way to remove them is click on them and when the message "the item 'WhatEver.hmtl' that this shortcut refers to has been changed or moved, so this shortcut will no longer work properly.   Do you want to delete this shortcut?" apears to answer yes.

    But this is rather ugly so I want to clear this list of short cuts as well.

    Hope my intention is more clear now^^ the acutally registry clearing for the word interal MRU already works like mentioned in your linked post Eugene.

    Monday, March 16, 2015 7:05 AM
  • Hi Aeglasin,

    >> I would expect that the file "Export_lirumLarum.docx" is nether in the "Recent" list that is displayed if I rightclick the Word icon nor in the list that is displayed by Word itself.

    I have made a test with your code, and I could not reproduce your issue. For the file list in the recent file in the word open page, I would recommend you remove the file in this page before you test the code, or you could edit the "Export_lirumLarum.doc" to a new name. For the file displayed if you right click on the Word icon, it could not be achieved with the code. If you want the icon do not show the recent file, for a workaround,you could do as picture below:

    TempFile.gif

    In addition, to check whether the file is added to the recent files, I think you could bebug the code step by step.

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Monday, March 16, 2015 12:51 PM