Should we develop add-in based on the normal template?

N

Nick

Hi,

Currently, I am developing an adding for MS Word, should I use my own
template for the add-in or just use the normal.dot?

The problem is that:

1. I need to delete the menu item every time when the word close, so as
to prevent duplicate menu item appear when the word run next time.

2. This is done by saving the normal.dot

Is this procedure correct?

Any comments?

Thanks.

Nick
 
C

Cindy M -WordMVP-

Hi Nick,

Since it's not clear what the addin is to be used for, it's a bit difficult
to give you a really good answer. I can say that it's usually a BAD idea to
do anything to the user's Normal.dot.

If you're providing the template as a true addin, it should be enough to
create and store the menu in the template (set the CustomizationContext to
the template) before you distribute it. The menu item should appear
whenever the addin is loaded; and disappear when it is not...
Currently, I am developing an adding for MS Word, should I use my own
template for the add-in or just use the normal.dot?

The problem is that:

1. I need to delete the menu item every time when the word close, so as
to prevent duplicate menu item appear when the word run next time.

2. This is done by saving the normal.dot

Is this procedure correct?

Any comments?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 
N

Nick

Hi Cindy,

Thanks,

If I set the template during add-in's load, will it conflict with other
add-in to be run which might also have their own template?

How to avoid this?

Thanks.

Nick
 
C

Cindy M -WordMVP-

Hi Nick,
If I set the template during add-in's load, will it conflict with other
add-in to be run which might also have their own template?
I think you'd better explain what kind of components/setup you have in
mind. As a long-time "Wordie", when someone mentions template and addin in
the same sentence, my first reaction is to assume the template IS the
addin. But I get the feeling you have something else in mind? a COM Addin?
Can you describe, please, in a general way, what it's supposed to do? Will
a specific template be associated with it? What are the menus for?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 
N

Nick

Hi,

Yes, they are COM add-in, written using VS.NET + C#

To make it more easy to understand, consider the following:

1. I have two word add-in on load
2. They both have their own menu, create when load, delete when exit
3. Between deletion of menu and exit, the current template need to be
save to avoid duplicate menu item appear next time.

The problem is:
1. Should I give these two add-in load their own templates when load?
2. Which default template will load when word start? (since they are
referencing 2 templates)
3. Will there be any conflict?


Thanks.

Nick
 
C

Cindy M -WordMVP-

Hi Nick,

OK, now I understand better.

In this case, it seems you have no choice than to modify the Normal
template. Be certain to set the customization context to that both when
creating and removing the menues.

Furthermore, I recommend that each Addin creates its OWN, separate menu
in the menu bar (or its own, separate CommandBar). This way there should
be no conflict. If you're worried about identifying the menus when
removing them, write a unique value (such as a namespace or a GUID) to
each addin's top-level CommandBarPopup control's TAG property. This will
allow you to test whether you're addressing the correct control when
deleting on unload.
Yes, they are COM add-in, written using VS.NET + C#

To make it more easy to understand, consider the following:

1. I have two word add-in on load
2. They both have their own menu, create when load, delete when exit
3. Between deletion of menu and exit, the current template need to be
save to avoid duplicate menu item appear next time.

The problem is:
1. Should I give these two add-in load their own templates when load?
2. Which default template will load when word start? (since they are
referencing 2 templates)
3. Will there be any conflict?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :)
 
N

Nick

Hi Cindy,

In fact, the other add-in is not created by me, they are third party
add-in, what my question is :

1. This third party add-in already has its own template (its has its own
menu)
2. If my add-in also use my custome template , will there be any conflict?
3. These two add-in will set its own template when load, in fact, which
template is applying to the current document ?

Thanks!
Nick
 
C

Cindy M -WordMVP-

Hi Nick,
In fact, the other add-in is not created by me, they are third party
add-in, what my question is :

1. This third party add-in already has its own template (its has its own
menu)
2. If my add-in also use my custome template , will there be any conflict?
3. These two add-in will set its own template when load, in fact, which
template is applying to the current document ?
I don't have enough information about how both addins work. Is the
third-party addin based only on a template, or is it a COM-Addin, as well?
If the latter, in that case, does it load a template? In what manner?

And how do you envision using your custom template? When will it be loaded?
And what will trigger its loading?

The only things I can tell you for certain are 1. that NO Addin template
will apply specifically to the "current document". The current document will
be attached to the template from which it was generated, and anything in
that template will have the highest priority and override anything in an
Addin that *duplicates* something in the template.

2. In principle, addins should be able to exist side-by-side, if they've
been correctly and "politely" programmed. Conflicts would only occur if two
Addins try to "occupy the same space". Then the Addin that's loaded last
overrides earlier addins.

3. There is no way to predict which Addins Word loads in what order, unless
the installation uses only a single addin that loads all other addins,
explicitly.

4. Therefore, as I said before, your best bet for no interference is to
create your own toolbar, rather than trying to use one built into Word.

To find out whether that other addin is going to interfere, you're simply
going to have to test with it installed and see what it does...

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :)
 
N

Nick

Hi Cindy,
third-party addin based only on a template, or is it a COM-Addin, as
well?

Yes, it is also COM-addin, it will attach its own template on addin-load
(and I don't know its functions)
And how do you envision using your custom template? When will it be
loaded? And what will trigger its loading?

My own template will also load when the add-in is loaded. In fact, I
store nothing in the template. The reason I need to use the template is
to prevent duplicate menu item (This is done by saving the template
after deleting the menu item), but you said saving to normal.dot is no
good, so I am thinking of creating a menu and deleting a menu on my own
template)
The only things I can tell you for certain are 1. that NO Addin template
will apply specifically to the "current document". The current document will
be attached to the template from which it was generated, and anything in
that template will have the highest priority and override anything in an
Addin that *duplicates* something in the template.

This seems to be my problem.
This is my understanding and to see if it is correct:

1. When I create a blank document/open an existing document, even the
2 add-ins are loaded,it will based on normal.dot (the templates attached
by the add-in perform no function on these document unless the document
is created by the add-in)

2. The menu items are saved in the attached template.

3. I should set the tag property of my menu item to prevent conflict.

Thanks again for your help.

Nick
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top