Debugging C# Word add-ins

A

Alex

Hello,

I am trying to create an MS-Word add-in in C# (in Visual Studio .NET 2003).
What complicates matters is that this is my first exposure to .NET, C# and MS-Office add-ins so I am learning as I go along...

I have encountered a problem:

When I create the project in Visual Studio, I specify whether to load the add-in automatically.
If I tick the box, the add-in is loaded even if I start Word from outside the Visual Studio environment.
If I don't, when I run the project from Visual Studio, Word starts but the add-in is not loaded and I cannot debug it.

Is there a way to load the add-in only if I invoke Word by running the project in Visual Studio?

Thank you in advance,
Alex.
 
A

Alex

Anyone?

Alex said:
Hello,

I am trying to create an MS-Word add-in in C# (in Visual Studio .NET 2003).
What complicates matters is that this is my first exposure to .NET, C# and MS-Office add-ins so I am learning as I go along...

I have encountered a problem:

When I create the project in Visual Studio, I specify whether to load the add-in automatically.
If I tick the box, the add-in is loaded even if I start Word from outside the Visual Studio environment.
If I don't, when I run the project from Visual Studio, Word starts but the add-in is not loaded and I cannot debug it.

Is there a way to load the add-in only if I invoke Word by running the project in Visual Studio?

Thank you in advance,
Alex.
 
C

Cindy M -WordMVP-

Hi Alex,


Sometimes, it takes a while until somebody cruises through with an idea for a
particulat question... Like you, most of us work for a living, and only visit
when we have free time :)

My two cents: An addin is the wrong tool. Difficult to say which the correct
one might be, since you don't tell us any more about your project, but an
Addin is meant to be "global" - available all the time.

Either you want to create a project (*.exe) that people only run when they
want to do whatever. Or perhaps VSTO (Visual Studio Tools for Office) is what
you need.
I am trying to create an MS-Word add-in in C# (in Visual Studio .NET 2003).
What complicates matters is that this is my first exposure to .NET, C# and MS-Office add-ins so I am learning as I go along...

I have encountered a problem:

When I create the project in Visual Studio, I specify whether to load the add-in automatically.
If I tick the box, the add-in is loaded even if I start Word from outside the Visual Studio environment.
If I don't, when I run the project from Visual Studio, Word starts but the add-in is not loaded and I cannot debug it.

Is there a way to load the add-in only if I invoke Word by running the project in Visual Studio?

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

Alex

Hello Cindy,

Thank you for your reply.

Cindy M -WordMVP- said:
My two cents: An addin is the wrong tool. Difficult to say which the correct
one might be, since you don't tell us any more about your project, but an
Addin is meant to be "global" - available all the time.

Actually, I want it to be global -- once it is finished.
The problem is that bugs in the add-in that's in development cam interfere with my other usage of Word.
Either you want to create a project (*.exe) that people only run when they
want to do whatever. Or perhaps VSTO (Visual Studio Tools for Office) is what
you need.

I understand that VSTO is somewhat limited in VS 2003.
 
C

Cindy M -WordMVP-

Hi Alex,
Actually, I want it to be global -- once it is finished.
The problem is that bugs in the add-in that's in development cam interfere with my other usage of Word.
Ah. In the Word environment, through Tools/Customize/Commands, you can pull the Comm-Addins entry from
the Tools category to a menu or toolbar (generally, we put it near "Templates and Addins" in the Tools
menu). You should be able to use this to disable or add the COM-Addin at will.

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

Alex

Cindy M -WordMVP- said:
Ah. In the Word environment, through Tools/Customize/Commands, you can pull the Comm-Addins entry from
the Tools category to a menu or toolbar (generally, we put it near "Templates and Addins" in the Tools
menu). You should be able to use this to disable or add the COM-Addin at will.

Thank you Cindy,

Unfortunately, the add-in is not listed in the COM add-ins list.
 
C

Cindy M -WordMVP-

Hi Alex,
Unfortunately, the add-in is not listed in the COM add-ins list.
Fun-and-joy. OK, there's a KB article about how to handle COM
addins that aren't listed. It will tell you where to find them in
the Registry, and how to enable/disable (as I recall). You could
create a couple of little *.reg files to change the Registry
settings.

And, if you don't know how to do that, try asking in a Windows
group. It's been so long since I've done it, I can't trust myself
to give you accurate information without testing (and no time for
that, right now)

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

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