Word 2003 commandbar popups empty on second run

Add-in Express™ Support Service
That's what is more important than anything else

Word 2003 commandbar popups empty on second run
 
Stuart Kolodner




Posts: 35
Joined: 2009-10-09
Building an add-in for Word, Excel, Powerpoint 2003-2010. I'm using the ribbon for 2007 and 2010 and a command bar for 2003. Everything is working fine except for Word 2003. The first time I run, the command bar appears fine. All the commandbar popups appear as expected and work as expected. If I close Word and restart it, the commandbar popups are missing. A single small empty box is dropped where I expect to see a bunch of menu choices. If I delete normal.dot and restart word, the popups appear and everything works great.

What's going on? Should I be marking the commandbar and all the items contained in the toolbar as temporary? Originally, I had temporary set to false and ran into this problem so I changed it to true since I don't want to be updating normal.dot. It didn't change the behavior.

Note: I am uninstalling/installing everytime as I'm running this on a Virtual PC instance of XP.
Posted 02 Jun, 2011 18:22:54 Top
Eugene Astafiev


Add-in Express team


Posts: 8540
Joined: 2007-07-25
Hi Stuart,

Are you able to reproduce the issue with a newly created add-in project (set the Temporary property to true)? If so, could you please send it to me for testing?

BTW What version and build number of Add-in Express do you use?
.NET, Extended MAPI, Windows Phone & RT
Posted 03 Jun, 2011 03:26:49 Top
Stuart Kolodner




Posts: 35
Joined: 2009-10-09
I duplicated this with a brand new project with temporary set to true.

I'm running v6.3.3052 as displayed in the Visual Studio 2008 About Box.

Where do I send this test project?



Note about my real project ... I thought this was working fine and then stopped working. Was it when I set temporary to true? I was trying to fix a problem by setting temporary with disabled menu items when I set it to true. One weirdness in my real project is that when I set temporary to "true", it added statements to set temporary to "true" to each and every button and dropdown in my command bar, not just the top level.
Posted 03 Jun, 2011 07:47:58 Top
Eugene Astafiev


Add-in Express team


Posts: 8540
Joined: 2007-07-25
Hi Stuart,

Thank you for providing me with a sample add-in project. I will test it in one of my virtual PCs and then let you know the results. Anyway, please take a look at the How command bars and their controls are created and removed? section in the online documentation. Does it help?

FYI Please note that you use an old build of Add-in Express 2010. You can download the latest build from our web site. Then please don't forget to replace the adxloader.dll in the Loader folder of your project with a new one (see the Redistributables folder).
.NET, Extended MAPI, Windows Phone & RT
Posted 03 Jun, 2011 08:01:15 Top
Stuart Kolodner




Posts: 35
Joined: 2009-10-09
I read the page you referenced. Can you explain one section of interest:


However, it doesn't remove temporary command bar controls, at least some of them; it just hides them. When the add-in starts for the second time, Add-in Express finds such controls and connects to them. Accordingly, because Add-in Express doesn't change the visibility of existing controls, the controls are missing in the UI.



Is this explaining the behavior I see? Please explain the last line which states that Add-in Express doesn't change the visibility of existing controls. What turned off their visibility?
Posted 03 Jun, 2011 09:15:09 Top
Eugene Astafiev


Add-in Express team


Posts: 8540
Joined: 2007-07-25
Hi Stuart,

Thank you for providing me with a sample add-in project. I have reproduced the issue you described above in one of my virtual PCs with Windows XP SP3 and Office 2003 SP3. Moreover, when I set the Temporary property of your command bar to true all controls works like a charm.

It looks like this is exactly the case described in the documentation. Please keep the Temporary property of your command bars in Word set to false.

Is this explaining the behavior I see? Please explain the last line which states that Add-in Express doesn't change the visibility of existing controls. What turned off their visibility?


Yep. In case of Temporary=true when you close Word your command bar is removed but the controls continue living. You can use the Built-in Controls Scanner utility for inspecting command bars and controls in Word 2003.
.NET, Extended MAPI, Windows Phone & RT
Posted 03 Jun, 2011 10:51:48 Top
Stuart Kolodner




Posts: 35
Joined: 2009-10-09
OK ... I will not fight it. Temporary is now false.

Now I'm back to the problem I had before I changed Temporary to true. I have a problem where popups on the command bar, that are disabled before closing Word, are still disabled when I restart Word. I have code to enable those buttons in the AddInInitialize event handler but they're not enabled.
Posted 06 Jun, 2011 11:45:09 Top
Eugene Astafiev


Add-in Express team


Posts: 8540
Joined: 2007-07-25
Hi Stuart,

Sorry, but I don't quite understand the issue you faced with. Could you please describe it in detail?
.NET, Extended MAPI, Windows Phone & RT
Posted 07 Jun, 2011 03:50:50 Top
Stuart Kolodner




Posts: 35
Joined: 2009-10-09
Our add-in has a command bar that's available in Word 2003. The command bar contains some popups and some buttons. Problematic sequence:

1. Start Word 2003.
2. Based on the current document and other external factors, the add-in grays buttons and popups on our command bar (via Enabled = false).
3. Close Word 2003 and restart it.
4. Those buttons/command bars that were grayed during the last invocation of Word are still disabled even though there is code to enable them in the AddInInitialize event handler.


This is rather low priority on my list of items so I wasn't planning on spending a bunch of time figuring out how to make this work. My first thought had been that there was state being saved by Word because temporary was false; hence my attempt to set temporary to true.
Posted 07 Jun, 2011 10:16:09 Top
Eugene Astafiev


Add-in Express team


Posts: 8540
Joined: 2007-07-25
Hi Stuart,

Thank you for the detailed description of the issue you faced with. I have reproduced the issue in one of my virtual PCs with Word 2003 SP3 and Windows XP SP3.

Please note that non-Temporary controls remains its state between sessions. If you set the Temporary property to true your controls will be recreated when the host starts. Anyway, you can use the following code to update the state of your non-Temporary property:

private void AddinModule_AddinStartupComplete(object sender, EventArgs e)
{   
    adxCommandBarButton1.UpdateControlObj(this);
    adxCommandBarButton2.UpdateControlObj(this);
}


Does it work for you?
.NET, Extended MAPI, Windows Phone & RT
Posted 08 Jun, 2011 04:23:58 Top