1
votes

I am creating a VSTO Word 2007 C# Add-In using Visual Studio 2010. I want to add controls to Word's Quick Access Toolbar (QAT) so that a user becomes aware of the functionality that these controls expose (they replace builtin Word functionality, viz. undo/redo.) I am using ribbon XML to customize the ribbon, so in order to add controls to the QAT, I must use <ribbon startFromScratch="true">. Unfortunately, doing so disables the users ability to further customize the QAT by adding back controls they would like to see there. (The "Customize Quick Access Toolbar" drop down menu has all the commands that could be added grayed out, and the "More Commands" button is also grayed out.) Doing this also removes any controls from the QAT that a user may have previously put their for their convenience.

The ribbon XML I use to reproduce this problem is:

<?xml version="1.0" encoding="UTF-8"?>
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui" onLoad="Ribbon_Load">
  <ribbon startFromScratch="true">
  </ribbon>
</customUI>

What I want to know is:

1) Is there a way to allow a user to modify the QAT after adding my own controls to the QAT? (Ideally I would preserve the user's previous QAT customizations.) Alternatively,

2) is there another way to get my controls into the QAT that would not erase the user's customizations and allow the user subsequently to modify the QAT?

Thanks!

2

2 Answers

1
votes

I think the approach I am going to take is to modify the user's custom QAT file located at (for WinXP):

C:\Documents and Settings\Administrator\Local Settings\Application Data\Microsoft\Office\Word.qat

I haven't had the time to implement yet, though, so I'm not sure that I will be able to modify the file before Word locks it, or in time for Word to load it. Perhaps I can cause Word to reload it.

0
votes

If you use startFromScratch="true" you'll always get this problem. If you're over-riding things like undo/redo, why not just override those buttons with your functions? Temporarily Repurpose Commands on the Office Fluent Ribbon