COM Addin suddenly fails


Peter Karlström


I have been working in a COm Addin project for Word since 2006.
Today "some" parts of the component suddenly stops working.
When testing, everything works fine in Debug mode in Visual Studio 6 (VB).
But when I compile the DLL and try it out just some parts work.
The Design-parts of the code with AddinInstance_OnConnection and
AddinInstance_OnStartupComplete run as usual, but the Word events
DocumentOpen and WindowActive doesn't trigger at all.
When I double-click on a Word document in Windows Explorer, Word starts as
usual, but the document window is empty and my toolbar isn't visible.
If I double-click the document file a second time it shows up and everything
works as before.
The code or the component is not changed and this problem did not exist
If I unregister my COM Addin documents open as before. If I reregister it
the problem starts again.
So I have tried to repair AND reinstall Office. I have uninstalled the
latest Word 2003 patch wich I installed along with som other fixes this

Also, I have a similar COM Addin for Excel but no problem there.

I'm beginning to be desperate, and really hope that the problem hasn't
occured yet at my customers 200+ PCs.

Is there anybody who know what to do about this.

Thanks in advance



Jialiang Ge [MSFT]

Hello Peter,

I can understand you are worried about the possible influences on your
customers due to this break issue. I will spare no efforts to help you. If
you feel it not efficient to trouble-shoot it in newsgroup, please don't
hesitate to email me and we can take it offline; If this is a very critical
issue for you, I'd suggest submitting a service request by using your MSDN
free support incidents, so you will talk to the Office support
professionals directly. This should be the quickest way to resolve this

According to your issue description, the COM add-in written in VB6 seems
not working when we open a word document in Windows Explorer for the first
time, and this problem starts from yesterday in your computer. I suggest we
start to trouble-shoot with the following step lists:

1. First, please close all the Word instances and make sure no winword.exe
exists in Task Manager.

2. Determine whether the COM add-in is loaded in Word
The KB article demonstrates how to
check whether a COM add-in is loaded successfully. When we open the doc in
Windows Explorer, would you follow its steps to see if our COM add-in is
loaded? You may also need to check if the add-in is disabled in Word
Disabled Items (Help->About Microsoft Office Word->Disabled Items?. If you
find the add-in in Disabled Items, there must be an unhandled exception
thrown from OnConnection or OnStartupComplete.

3. Determine whether the problem is due to other add-ins in Word
Have you installed any add-in recently? We can temporarily disable other
add-ins in Word from COM Add-in list (Tools->COM Add-ins?, and see whether
our add-in starts to work as expected.

4. Determine whether the problem is for the DocumentOpen and WindowActive
events only.
We can register other events (e.g. WindowSelectionChanged) in the add-in,
and see if they will be triggered.

5. Determine whether the problem is for the specific Word document only.
We can create a new (empty) doc and open it in Windows Explorer, and see
whether the add-in works or not.

6. Determine whether the problem can be reproduced in other machines
If you cannot find another machine for test, please feel free to send the
add-in to my mailbox, and I will test it for you. My mail address can be
found in the signature.

The steps above can help us narrow down the focus. Please spend some time
on them and let me know the results.

Jialiang Ge ([email protected], remove 'online.')
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

Get notification to my posts through email? Please refer to

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
This posting is provided "AS IS" with no warranties, and confers no rights.

Peter Karlström

Hi Jialiang Ge

This is a very strange problem, and I will do my best to respond to all your

1. I have checked that no other instances of winword is running before test.

2. I tested to put a MsgBox in the code on the following parts:
OnConnection, OnStartupComplete, WindowActivate and DocumentOpen. When I ran
it in Visual Studio Debug-mode all the messages were shown. When I compiled
it and tried again, only OnConnection and OnStartupComplete was shown. I also
checked for other instances during this test.

3. I looked in the registry HKLM and HKCU in
Software\Microsoft\Office\Office11\Word\Addins and set all addins
LoadBehavior to 0. Problem is still there as described in no. 2 above.

4. This is tested but only when I got a document finaly loaded. All events I
use (DocumentBeforeClose, DocumentBeforeSave, DocumentOpen, WindowActivate
and WindowOnSelectionChange) works as they should when a document is opened.

5. The problem persists on all word-documents I have tested, even new ones.
A funny thing though: When my Addin is registered, I get an error when
opening a document from Recent in the Start menu. The errors titlebar
consists of the path and name of the file (which is correct) and the message
says: <Can't find the file (correct filname and path). Check to see if you
entered the correct name and try again. You can search for the file in the
Start menus Search.>
When I unregister my Addin the same document (and others) open up without
any errors from the Recent menu.

6. I have just tested my Addin on a laptop with same OS and Office version,
and the problem does not exist there. It seems to be only in my developer
Both PCs have recently been updated with Windows XP SP3 and the Office fixes
which was enrolled earlier this week.

No. 5 above seems to be a lead. Can it be something wrong in the
DDE-communication from exlorer.exe to winword.exe when my addin is loaded?
The Addin is getting rather big (4.2 Mb). I don't know if this could be the
problem. I have discussions with the customer to separate some of the
function and split the dll into smaller parts.

Thanks for your support

Peter Karlström
Midrange AB

Peter Karlström

Hi Jialiang Ge

It looks as if the problem is gone.
I have been working with both the Word and the Excel Addin today and made some
changes (but not in the parts we've been talking about before) and suddenly
the problem is gone. Tha compiled versions now opens up documents and
spreadsheets as the should. I have not a clue what I could have done to fix

I suggest we let this be at the moment and I will post a new question if
this problem returns. I hope you have not spent too much time digging for a

Best Regards

Peter Karlström
Midrange AB

Jialiang Ge [MSFT]

Thank you, Peter. I am sorry in that I still have not figured out the
possible reasons behind it. I failed to reproduce the symptom on my side,
and did not find similar issue reports in our internal data base. If this
problem happens again, please let me know. I will monitor it closely and
help you find out the root cause.

Jialiang Ge ([email protected], remove 'online.')
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

This posting is provided "AS IS" with no warranties, and confers no rights.



Peter Karlström

Hi Jialiang Ge

Thank you. I hope this problem never to come back.
I have checked with my contact at my customer, but he have not heard
anything about a problem like this in all their installations.
If the problem comes back, I will be sure to let you know.

Thanks again for your support



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