Word suddenly rejects all COM add-ins I create

C

Christine

I've been working on an add-in for MS Word. It started as an extensibility
"shared add-in" project in VisualStudio.NET 2003, so it's managed code,
VisualBasic.NET.

Recently, I added some new code that was throwing exceptions, so I went to
the task manager and killed the Word process in which my DLL was running.

After this, Word (Office Professional 2003) would no longer load that
add-in. Furthermore, if I create a new extensibility project in Visual
Studio, with just a message box in the OnConnection subroutine of the Connect
class, saying "On Connection reached", and build, Visual Studio seems to
create all the right registry entries (I change load behavior to 8, load on
demand in regedit), but the DLL won't load.

In both cases, the DLL will display in a list of COM add-ins for an instance
of Word. When I try to load the DLL through the Word interface, the add-in
load behavior entry in the registry is changed from 8 to 9 (indicating
"connected," as I understand it), but the code in the OnConnection class does
not execute. Furthermore, if I re-open the COM Add-in dialog, the DLL is not
shown as loaded (though, as mentioned earlier, the registry LoadBehavior
value has, at this point, been set to 9).

I tried a new project, same "extensibility" profile, with load-on-start-up
behavior. It failed to load, similarly to the add-ins described above.

Having run reinstall/repair on Visual Studio, Word, Visual Studio Tools for
Office, just to be sure nothing fundamental had gotten broken, I am mystified.

This reminds me a little of how Macros and wlls fail silently to "load on
demand" with high security settings, and I'm wondering if there is a security
issue. Word security is medium and "trust all installed add-ins" and "trust
access to your visual basic project" are checked.

I'm mystified, and haven't been able to find anything in the MSDN knowledge
base or literature.

Can anyone shed some light?

Thank you.

- Christine
 
A

aidan.hutchinson

This has happend for me for all Office apps, esp Outlook.

My add ins tend to load after install then the second time i launch
word etc the toolbar sits there but no code execs behind.

All i can suggest is that you keep an eye on some of the replys in my
threds also, perhaps someone will cast some light on this issue.
 
T

telephasic.workshop

try this:
open word
go to help --> about microsoft office word
click on the disabled items button
if your add-in is listed in the box highlight it and click enable

i am having the same problem with the load behavior registry setting
changing to 9. i keep having to reset it to 8. it sets itself to 9
after i have loaded it for the first time. if anyone can please shed
some light i would really appreciate it.
 
C

Christine

Your response solved my problem - thanks so much!

Regarding the registry problem you mention, now that the add-in can be
loaded again, I find that if the add-in is unloaded using the "COM Add-ins
.... " item on the Tools menu (i.e., symmetrically with how it was loaded),
there is no problem; the LoadBehavior registry entry is re-set to 8. However,
if Word is shut down with my add-in still in place, then when Word is
re-started, my add-in is marked "connected" in the registry. How it shows up
in the COM Add-ins box is somewhat inconsistent. The add-in is checked (this
seems to be directly linked to the load status in the registry) however,
right underneath, the status is shown as "Load on demand (not currently
loaded)."

I'm planning to post a more complete description of this situation, starting
a new thread, to see whether anyone can make sense of it.
 

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