You are here: Office-Outlook.com  / Outlook Forum

Word 2002 Add-in and Templates (".dot")

Home » Outlook addins and plugins development » Developer Outlook add-ins
Word 2002 Add-in and Templates (".dot") [message #1152] Mon, 25 September 2006 02:04 Go to next message
Bala
Messages: 24
Registered: August 2006
Junior Member
Hi all,

For starters, I've succesfully developed a .NET add-in voor Word 2002
using Shims and Office XP Interop Assemblies. The add-in is built in
such a way, that it becomes active only when a certain template file is
loaded into Word. The add-in actually does something like this on
startup (mind the seperate lines of execution after step 2!):

1) Add-in is loaded on Word startup
2) Add-in checks for certain template to be loaded
3a) The template is not loaded, the add-in doesn't do anything
3b) The template is loaded into Word, the add-in adds some buttons to a
toolbar belonging to the template.

My problem is as follows:
Word doesn't always seem to load the template in-time for the add-in to
notice that the template is loaded! For example: when I put the
template (the .dot file) into the Office\Startup folder, the add-in
works fine (that is: the add-in notices that the template is loaded and
adds the buttons to the toolbar). However, when I start Word from the
commandline and try to load the template using commandline arguments,
the add-in doesn't add the buttons to the toolbar! It seems to be as if
the template is loaded after the add-in is loaded. Again, this behavior
does not occur when the template is put into the Office\Startup folder.

Can anybody shed some light on this issue?! Am I right and is the
add-in loaded prior to the template when we use the commandline
options?!

Please help because we definitely do not want to put the template file
into the Office\Startup folder, because we wanted to use the template
to distribute the new functionality to specific users on our network,
not to all users.

Thanks in advance,

Alke Wiebenga
Re: Word 2002 Add-in and Templates (".dot") [message #33081] Tue, 26 September 2006 01:48 Go to previous messageGo to next message
Bala
Messages: 24
Registered: August 2006
Junior Member
Hi,

Thanks for the response!

Maybe I should have mentioned that I am creating an add-in for a Citrix
/ Terminal Server environment. The add-in is installed on every
Terminal Server.

The template being loaded doesn't really do anything. It's only use is
to indicate whether or not the add-in should perform some actions (in
this case, add buttons to a toolbar). So if we want certain users to
get the add-in functionality, we just issue the template to certain
users and the add-in does its' magic. So the template is only used as a
"flag" or "marker" to indicate whether or not the add-in should do
anything.

In more detail, the add-in works like this:
- When the add-in starts, it immediately checks whether or not a
specific template is loaded into Word.
- If the template is loaded into Word, the add-in adds buttons to a
toolbar and thus delivers its' functionality to the user.
- If the template isn't (yet) loaded into Word, the add-in will not add
buttons to the toolbar and the user will not get any add-in
functionality.

The isssue at hand is this: when we put the (flag) template into the
Office\Startup folder, the add-in works fine. That is: the buttons are
added each time we start Word.
However, we do not want every user to get the add-in functionality, so
we don't want the template to reside in the Office\Startup folder. So
when we start Word using the commandline parameters for loading a
template, the add-in does not add the buttons to the toolbar.

Commandline: C:\Program Files\Microsoft Office\Office\Winword.exe
/t"mytemplate.dot"

What I think is happening is this:
The add-in is supposed to load after the Word application has started,
when we put the template in the Office\Startup folder, the template is
already loaded when the add-in starts, and we get the desired outcome.
When we start Word using the commandline switches, the add-in loads
prior to the template and does nothing (which is correct by the
add-in's design).

So the real question is: am I right in my statement above or am I
totally missing something?

If I am right, is there another way to get the functionality I want?!

Thanks in advance,

Alke




> Hi Alke,
>
> Can you explain more about this template: Is it also supposed to load as
> an Addin? Show us an example of the command line you have in mind?
>
>
> Cindy Meister
> INTER-Solutions, Switzerland
> http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
> 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 :-)
Re: Word 2002 Add-in and Templates (".dot") [message #34945] Wed, 27 September 2006 00:53 Go to previous messageGo to next message
Bala
Messages: 24
Registered: August 2006
Junior Member
Hi,

Thanks again for the reply. I'm not real sure howto start a ".NET
Add-in" from the commandline. I've tried starting Word and the add-in
using the "/l" parameter but it didn't do anything. I've tried the
"/l"-switch with both the path to the add-in as well as the path and
filename of the COM Shim of the add-in. Neither worked.

I'm running out of ideas...



Cindy M. schreef:

> [.... Cut some text away for readability ......]
>
> Rather than the /t"template name" switch, try the /l"add-in path"
> switch. This should start Word and loaded the specified template add-in.
>
> Cindy Meister
> INTER-Solutions, Switzerland
> http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
> http://www.word.mvps.org
Re: Word 2002 Add-in and Templates (".dot") [message #35417] Thu, 28 September 2006 00:37 Go to previous messageGo to next message
Cindy M -WordMVP-
Messages: 846
Registered: June 2006
Senior Member
Hi Alke,

> Thanks again for the reply. I'm not real sure howto start a ".NET
> Add-in" from the commandline. I've tried starting Word and the add-in
> using the "/l" parameter but it didn't do anything. I've tried the
> "/l"-switch with both the path to the add-in as well as the path and
> filename of the COM Shim of the add-in. Neither worked.
>
Not of the COM Add-in, of the TEMPLATE Add-in. When you load a template
globally (for example, by putting it in the Startup folder), Word
considers it to be an Add-in.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
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 :-)
Re: Word 2002 Add-in and Templates (".dot") [message #37625] Wed, 04 October 2006 00:08 Go to previous message
Bala
Messages: 24
Registered: August 2006
Junior Member
Ah,

Sorry, I didn't know!!!
It's clear to me know, I'll try this!

Thanks!


Cindy M. schreef:

> Hi Alke,
>
> > Thanks again for the reply. I'm not real sure howto start a ".NET
> > Add-in" from the commandline. I've tried starting Word and the add-in
> > using the "/l" parameter but it didn't do anything. I've tried the
> > "/l"-switch with both the path to the add-in as well as the path and
> > filename of the COM Shim of the add-in. Neither worked.
> >
> Not of the COM Add-in, of the TEMPLATE Add-in. When you load a template
> globally (for example, by putting it in the Startup folder), Word
> considers it to be an Add-in.
>
> Cindy Meister
> INTER-Solutions, Switzerland
> http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
> 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 :-)
Previous Topic:New form freezes on CommandBarButton.Click
Next Topic:Outlook plugin c# - Thread keeps outlook.exe process in Task Manag
Goto Forum: