(X-Posted) How Do I Add a ToolWindow to Word Using C# Add-In

K

Ken Wilson

I am attempting to add a tool window to Word 2003 to house a user
control containing a WebBrowser component. This window will be
used to display one of two web interfaces to a server, either a
login or a selection tool.

There does not appear to be a ToolWindow component similar to what
is available in VS2005's automation model. Are there any objects
or methods to allow this from within a C# add-in or is it up to
the author of the add-in to handle all this without referencing
components and methods available from the Word or Office
automation objects.

Thanks in advance for your replies and suggestions.

Ken Wilson
Seeking viable IT employment in Victoria, BC
 
C

Cindy M -WordMVP-

Hi Ken,
I am attempting to add a tool window to Word 2003 to house a user
control containing a WebBrowser component. This window will be
used to display one of two web interfaces to a server, either a
login or a selection tool.

There does not appear to be a ToolWindow component similar to what
is available in VS2005's automation model. Are there any objects
or methods to allow this from within a C# add-in or is it up to
the author of the add-in to handle all this without referencing
components and methods available from the Word or Office
automation objects.
From what I know, best you could probably manage would be to try
putting the user control into a CommandBar, or adapting a control
type that can be used on a CommandBar to do what you require.

This is basically the approach used by the Office task pane - which
is an ActiveX control in a CommandBar. The "Document actions" pane
supported in VSTO 2005 embeds Windows Forms as well as User controls
into this ActiveX control. However, VSTO 2005 can't generate global
Addins for Word or Excel (the next version probably can, though -
there's "preview" up on the VSTO site at microsoft.com).

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 :)
 
K

Ken Wilson

Hi Ken,

From what I know, best you could probably manage would be to try
putting the user control into a CommandBar, or adapting a control
type that can be used on a CommandBar to do what you require.

This is basically the approach used by the Office task pane - which
is an ActiveX control in a CommandBar. The "Document actions" pane
supported in VSTO 2005 embeds Windows Forms as well as User controls
into this ActiveX control. However, VSTO 2005 can't generate global
Addins for Word or Excel (the next version probably can, though -
there's "preview" up on the VSTO site at microsoft.com).

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 :)

I'm not using VSTO 2005 but using the shared add-in template in VS
2005. I have advanced my problem slightly by using a Form and adding
my control to the form. I have a CommandBarButton that I have added
to the Tools menu which triggers my add-in to display the form. My
current problem now is the form doesn't disappear when dismissed.

Ken Wilson
Seeking viable IT employment in Victoria, BC
 

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