Remove Normal.dot

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

Remove Normal.dot
What happens when the user removes Normal.dot 
John Smith




Posts: 20
Joined: 2006-10-11
These have probably been answered before but I can't seem to find the solutions in the forum.

I'm adding dynamic items to the standard File menu. The structure is like:
CommandBar
Static Button
Static Button
Pop Up
Dynamic Button
Dynamic Button

When the Add in is first registered and I bring up Word everything seems fine.
Now, I tried to make changes to the Dynamic Buttons and that didn't work. Why? probably because the items were stored in Normal.dot.
So the first question is how do I check existing items? and how do I either remove them or reconnect to them?

Now, let's say that the user deletes his/her normal.dot.
When Word is started up again, the Add in doesn't show up at all under the File menu, not even the static items.
So the second question is how to I bring the add in back in? The initialize event does fire so I know the add in is there. I just need to reshow it, reconnec it.

This Addin is supposed to be used in Word, Excel and PowerPoint. The only thing that will change will be the Dyanmic Buttons above. Should I create multiple command bars or can I actually use the same command bar for all 3 applications?

And the final question...
Can the same command bar be both used in the standard menu and as a separate command bar the user can place in their toolbar? Or do I have to create separate ones?

Thansk so much for any responses.

If there are examples that I can use that would be Ideal.

Posted 11 Oct, 2006 07:58:37 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi John.

1. Are the dynamic buttons temporary?
If not, I would advise you to use the temporary buttons.
2. You can uncheck/check the add-in in the 'COM Add-ins' dialog in Word to reinitialize the add-in again.
3. You can use the same command bar for all applications.
4. You should create a separate command bar.
Posted 11 Oct, 2006 09:47:55 Top
John Smith




Posts: 20
Joined: 2006-10-11
Hi Sergey. Thanks for the quick response.

1) Yes they are temporary.
2) Yes, I can do that but I don't want users to have to do anything. That's not an option. I have provide a complete package that doesn't take any input from the user once it is installed. That's why I wanted to know how to check for existance and either delete or reconnect. It seems that I even have to provide the ability to perfom updates once a new Add In is distributed. At least I have to be able to detect if I have to do any clean up.
3) OK.
4) OK.

I hope you can shed a bit more light. Even on the event the user deletes the normal.dot. The fact that none of the controls show up. I have to fix that.
Posted 11 Oct, 2006 10:53:17 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi John.

1.Try to remove all dynamic buttons when Word closes and add them whenever it starts. To find/reconnect the existing buttons you can use the FindControlObj method of the addinmodule.
2. All ADX conrols are registered in the system registry.
if the user deletes a control manually using the Customize dialog in Word, ADX will not add the control again. This is the designed behavior of ADX. The situation is the same with the Normal.dot template. I don't think that ADX should process the sutation with deleting the template. Moreover I think the user shouldn't delete the Normal.dot because it may affect other add-ins running in Word.
Posted 12 Oct, 2006 06:15:38 Top
John Smith




Posts: 20
Joined: 2006-10-11
Thanks Sergey.

1) This is not always possible. Applications do crash in which case I would not be able to run this process. However, I do know how to find the controls, but I don't know how to reconnect them. Could you please give me a quick example on how to do that?

2) I agree if the user deletes the control manually, there is nothing I can do since the control would no longer be running. And, it's true, the user should not delete the normal.dot, however it happens and I need to provide a way to recover if I can. I know that when the normal.dot is deleted the add in still fires. So from here I would like to determine if the buttons are present. If they are not I would like to reshow them. Deleting the normal.dot is different that the user manually deleting the control by using the Customize. That's the situation I want to handle (the deleting of the normal.dot since the add in still fires.)
Posted 12 Oct, 2006 07:01:47 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
John,

1. Ok, I will develop an example for you.
2. In this case you need to make all command bars/controls temporary and ADX will add/update them every time when Word starts. Or you can also add all command bars and controls dynamically in the add-in code.
Posted 12 Oct, 2006 07:10:05 Top
John Smith




Posts: 20
Joined: 2006-10-11
1) Thanks

2) You mean I should not have the static and dynamic buttons.

I can create a test project that will emulate the problem with the normal.dot if you'd like me to send it to you.


Sergey, again, thanks for the great support.
Posted 12 Oct, 2006 09:36:08 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
I meant that you should have all buttons dynamic.
There is no need to send me the test project. Thanks. I am able to reproduce this behavior myself.
Posted 12 Oct, 2006 11:56:55 Top
John Smith




Posts: 20
Joined: 2006-10-11
OK. I'll wait for your example.

Thanks.
Posted 12 Oct, 2006 14:38:43 Top
John Smith




Posts: 20
Joined: 2006-10-11
Sergey, when do you thin you will have the example ready? I want to plan my progress.

Thanks.
Posted 16 Oct, 2006 07:13:40 Top