Confused: Should I set Temporary or Not?

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

Confused: Should I set Temporary or Not?
Word settings for Best behavior 
David Smith


Guest


Ok, I'm officially confused.

I'm been using Add-in Express since the early 1.x version and have now moved on to 2.2. From the beginning, we have used the Temporary flag in controls. Early on, we found out that if we use non-Temporary controls that Word, etc. persisted our controls to normal.dot and even after uninstall, they still were displayed.

Now I have seen two postings that say:

1) Make controls non-temporary so they will not be written to normal.dot

2) Make controls temporary so that will *not* be written to normal.dot allowing the subsequent change of localization.

At the present time with temporary true, an un-register removes the commandbar toolbar but not the menu controls. Is this the common experience? How do I get rid of persisted toolbar and menu controls?

Thanks,

David
Posted 17 Jan, 2005 15:05:34 Top
Dmitry Kostochko


Add-in Express team


Posts: 2875
Joined: 2004-04-05
Hello David,

Is this the common experience?

Yes, it is one more "feature" of MS Word. If you add a custom control with Temporary := true to the Word native/standard command bar, Word ignores the Temporary parameter and doesn't remove this control but stores it to normal.dot. The macro below illustrates this.

Public Sub add_menu_controls()
Dim P As CommandBarPopup
Dim B1 As CommandBarButton, B2 As CommandBarButton

' File menu ID = 30002
Set P = Application.CommandBars("Menu Bar").FindControl(ID:=30002)
Set B1 = P.Controls.Add(msoControlButton, , , , True)
Set B2 = P.Controls.Add(msoControlButton, , , , True)

B1.Caption = "Test button 1"
B2.Caption = "Test button 2"

End Sub


How do I get rid of persisted toolbar and menu controls?

As you wrote above your temporary command bar is removed after uninstalling. To avoid controls freezing in the Word native command bars you are to make them non-temporary and Add-in Express will be able to remove them while an add-in is being uninstalled.

1) Make controls non-temporary so they will not be written to normal.dot

There seems to be some discrepancy/mistake here. Have you seen this on our forum? In this case we should make it clearer and more precise.
Posted 18 Jan, 2005 06:04:17 Top
David Smith


Guest


Hi Dmitry,

Thanks for the great support you guys provide.

To avoid controls freezing in the Word native command bars you are to make them non-temporary and Add-in Express will be able to remove them while an add-in is being uninstalled.


Does this mean that controls in the Menu Bar (and in native command bars like "STANDARD") should be non-Temporary?

Thanks,

David
Posted 18 Jan, 2005 22:28:05 Top
Dmitry Kostochko


Add-in Express team


Posts: 2875
Joined: 2004-04-05
Hi David,

Yes, MS Word controls in the native command bars ("Menu Bar", "Standard", "Formatting", etc.) should be non-temporary.
Posted 19 Jan, 2005 05:38:59 Top
David Smith


Guest


Hi Dmitry,

Per your instructions, I set the Temporary property of the CommandBar for the menu to be False. After the unregister, the menu items still remain.

Any thoughts?


Thanks,

David
Posted 20 Jan, 2005 09:10:30 Top
Dmitry Kostochko


Add-in Express team


Posts: 2875
Joined: 2004-04-05
Hi David,

The Temporary property of controls should be also set to False. Have you done this?

Posted 20 Jan, 2005 10:50:49 Top
David Smith


Guest


Hi Dmitry,

All the Temporary properties of the Controls are also False. A check of the DFM file confirms this.

To recap: the AddInModule contains two TadxCommandBars - adxCmdBar for the Custom Toolbar - adxMnuBar for the Customer Menu items. adxBar Bar its one button control are marked Temporary = True; adxMnuBar and its TadxCommandBarControl (1) and TadxCommandBarButtons (3) are marked Temporary = False;

Any further thoughts?


Thanks,

David
Posted 20 Jan, 2005 11:25:22 Top
Dmitry Kostochko


Add-in Express team


Posts: 2875
Joined: 2004-04-05
Hi David,

Strange situation. Could you please send us your project without functional code for testing?

BTW the code responsible for creating and removing command bar controls is executed when an add-in is being registered and unregistered.

Posted 20 Jan, 2005 12:01:09 Top
David Smith


Guest


Dmitry,

Thanks for *all* your help. It is working correctly now, with the unregister successfully removing both the tool and menu command bars.

To sumarize: the tool bar is marked as temporary and the menu controls are marked as non-temporary. To register and unregister, I am now calling REGSVR32.EXE with the /s silent switch. (For some reason, the TRegSvr type approach was not working very well.)

Again, thanks for your help.

Best,

David
Posted 28 Jan, 2005 07:15:02 Top
David Smith


Guest


Dmitry,

It is 60 days down the road and our customers are having issues with normal.dot that I think is related to the non-temporary menu setting.

Out of about 11,000 users who have upgraded so far, a few are having experiencing a complete lock up of Word on startup. Word basically either a) errors out and quits or b) GPFs. If I have the users delete all the normal.dot files, Word starts working again. I have talked to enough of the customers that I have isolated the cause of the problem to our add-in. We did not experience this behavior with 1.x using temporary command bars and menu items.

I am planning to issuing an update tonight that sets the menu items back to temporary.

DO you have any comments or suggestions?

Thanks so much,

David
Posted 17 Mar, 2005 11:18:59 Top