none
User customization of Add-In Ribbon does not persist in Project 2010

    Question

  • If the user customizes my add-in Ribbon in Project 2010, the customization disappears when the user restarts Microsoft Project. Try adding an add-in Ribbon button to the Quickaccess Toolbar, or re-ordering add-in Ribbon groups, and the changes disappear after a restart of the application.

    This is not a problem with Excel 2010 or Word 2010. I did a quick test using Visual Studio 2010. I created three brand new projects: a new Word 2010 add-in, a new Excel 2010 add-in, and a new Project 2010 add-in. I added a new Ribbon (visual designer) item in each project with a single button that displays a message when clicked. I compiled all three. If I add the button to the Quickaccess Toolbar in Word and Excel, the button remains in the Quickaccess Toolbar after restarting the application. But in Project 2010, I can add the button to the Quickaccess Toolbar, but it disappears when I restart the application.

    Has anyone else come across this problem or know how to solve it? It looks like a bug. I posted in the Microsoft Project forum a couple of weeks ago, but I didn't get any answers. I thought I'd try posting here since it only happens with Add-Ins (customizing built-in controls works fine).

    Thanks.

    Thursday, November 11, 2010 4:05 PM

Answers

  • Word, Excel, PowerPoint all accept and persist custom controls in the QAT.  MSProject does not persist these, but, as you discovered, does persist built-in commands. Until you reported it this behavior was not documented and is not reported as a bug.

    When you customize the QAT in VS debug mode - you create a MSProject.officeUI xml file - in the
    C:\Users\<username>\AppData\Local\Microsoft\Office folder.

    When you close MSProject 2010 with only the custom button in the QAT the MSProject.officeUI file disappears even though you customized the QAT. If you customize with a built-in command the MSProject.officeUI file persists, but your custom button is removed from the elements in the file.

    If you added your custom button to the Ribbon using a VSTO Add-in that button is still on the Ribbon even after you stop debugging. That's true even in MSProject.

    Excel creates a similar file - Excel.officeUI, Word creates Word.officeUI, etc. If you reset the modified QAT for Excel by manually removing all additions, both the custom button and any other built-in commands, you can watch the Excel.officeUI file disappear from the profile folder.

    A one-time fix is to copy the MSProject.officeUI file created when in VS debug mode, then paste it in another place (e.g. the desktop.) After the MSProject.officeUI file in the profile folder disappears, copy the copy from your desktop back into the profile folder. This will show the customized QAT at the next instantiation of MSProject, but ithe MSProject.officeUI file will disappear when you close the MSProject session. A workaround is to run a script to copy the backup file back to the profile folder after you close MSProject each time.

    You can learn more about the .officeUI file and using a script in the article

    - Deploying a Customized Ribbon and Quick Access Toolbar in Office ...
    http://msdn.microsoft.com/en-us/library/ee704589(v=office.14).aspx

    Thank you for using the Forum.


    Chris Jensen
    • Marked as answer by nikkopol Wednesday, November 17, 2010 8:10 PM
    Wednesday, November 17, 2010 7:31 PM
  • You'll need to test whether the sequence of events between the Add-in and MSProject's startup event will copy the file from the cached location into the profile folder in time for it to be applied by MSProject. Try caching the file in the BeforeShutdown event of MSProject (if there is one), the OnShutdown event may be too late.


    Chris Jensen
    • Proposed as answer by cjatmsModerator Thursday, November 18, 2010 4:34 PM
    • Marked as answer by nikkopol Friday, November 19, 2010 3:51 PM
    Thursday, November 18, 2010 4:34 PM

All replies

  • Word, Excel, PowerPoint all accept and persist custom controls in the QAT.  MSProject does not persist these, but, as you discovered, does persist built-in commands. Until you reported it this behavior was not documented and is not reported as a bug.

    When you customize the QAT in VS debug mode - you create a MSProject.officeUI xml file - in the
    C:\Users\<username>\AppData\Local\Microsoft\Office folder.

    When you close MSProject 2010 with only the custom button in the QAT the MSProject.officeUI file disappears even though you customized the QAT. If you customize with a built-in command the MSProject.officeUI file persists, but your custom button is removed from the elements in the file.

    If you added your custom button to the Ribbon using a VSTO Add-in that button is still on the Ribbon even after you stop debugging. That's true even in MSProject.

    Excel creates a similar file - Excel.officeUI, Word creates Word.officeUI, etc. If you reset the modified QAT for Excel by manually removing all additions, both the custom button and any other built-in commands, you can watch the Excel.officeUI file disappear from the profile folder.

    A one-time fix is to copy the MSProject.officeUI file created when in VS debug mode, then paste it in another place (e.g. the desktop.) After the MSProject.officeUI file in the profile folder disappears, copy the copy from your desktop back into the profile folder. This will show the customized QAT at the next instantiation of MSProject, but ithe MSProject.officeUI file will disappear when you close the MSProject session. A workaround is to run a script to copy the backup file back to the profile folder after you close MSProject each time.

    You can learn more about the .officeUI file and using a script in the article

    - Deploying a Customized Ribbon and Quick Access Toolbar in Office ...
    http://msdn.microsoft.com/en-us/library/ee704589(v=office.14).aspx

    Thank you for using the Forum.


    Chris Jensen
    • Marked as answer by nikkopol Wednesday, November 17, 2010 8:10 PM
    Wednesday, November 17, 2010 7:31 PM
  • Thanks for the reply Chris,

    How would your solution work for end-user customization in a commercial VSTO add-in? I can't run any code outside of my add-in. Should the add-in itself make a copy of "MSProject.officeUI" before MSProject closes down (during the Shutdown event) and overwrite it during the Startup using the saved copy (which it stashed away somewhere)? It seems a little kludgey, but I guess it could work. There's a chance that we could wipeout user customizations made while our add-in wasn't loaded, but I don't think that would keep me up at night.

    I am curious as to why this doesn't qualify as a bug. I can't think of a reason why MSProject shouldn't work the same as Word, Excel, and Powerpoint.

    Thanks

    Nic

    Wednesday, November 17, 2010 7:52 PM
  • You'll need to test whether the sequence of events between the Add-in and MSProject's startup event will copy the file from the cached location into the profile folder in time for it to be applied by MSProject. Try caching the file in the BeforeShutdown event of MSProject (if there is one), the OnShutdown event may be too late.


    Chris Jensen
    • Proposed as answer by cjatmsModerator Thursday, November 18, 2010 4:34 PM
    • Marked as answer by nikkopol Friday, November 19, 2010 3:51 PM
    Thursday, November 18, 2010 4:34 PM
  • Hello,

    thank you for this intersting topic, it seems that another scenario conducts to non persitsence of ribbon customization.

    I've no addin but enterprise global custom code.

    When a project server file is open and contains a macro, the ribbon customization of the enterprise global template is vanished in the air.

    Of course, as recommended by MSDN, all my events are trigered by the project open event


    • Edited by Arnaoud Wednesday, November 27, 2013 9:40 AM
    Wednesday, November 27, 2013 9:39 AM