Addin for Office XP, please help..

B

Bala

Hi all,

I've been coding an Office XP (Word 2002, SP3) add-in in C# (.NET v2,
Visual Studio 2005) for some time now. The add-in works perfectly on my
development machine, which has the Office XP PIA's installed.

I've been trying to deploy this add-in to a Windows 2003 terminal
server, which runs the same Ofice version as I do. Furthermore, I've
installed the Office XP PIA's onto this machine. For some reason or
another, the add-in does not show up in Word (the add-in is supposed to
add 3 commandbarbuttons to the "standard" toolbar during startup).
There are no errors, no eventlog messages, just nothing showing up.
I've tried to fix my problem using the solution which involves the
Office XP Add-in Shim solution, but using this just gives me the same
result (I've set the macro security of Office XP to "low", so I doubt
that I would even need a Shim, could somebody please confirm or deny
this?)

I've triple checked the Registry and it seems that everything has been
registered correctly.

I am lost for now. The project installs just fine, the registry is ok,
it runs great on my machine but I just can't seem to deploy this thing
to another server!!!

I really don't want to do the following, but I need to know if it could
fix my problem: Would it be a solution to use Office 2003 on the
terminal server instead of Office XP?

I really hope anyone has any suggestions regarding this matter,

Thanks in advance,

Alke Wiebenga
University Medical Centre Utrecht, The Netherlands
 
B

Bala

PS:
I've already stumbled upon
http://support.microsoft.com/kb/908002/en-us, which explains why VS
2005 Add-ins won't work in Office. I've followed the steps from this
article and installed the "Shared Add-in Support Update for the
Microsoft .NET Framework 2.0 (KB908002)" on my machine. I've also added
this support to my deployment project! During installation on the
Terminal Server, I can see that the Shared Add-in Support Update for
the Microsoft .NET Framework 2.0 (KB908002) is installed. So, this does
not seem to fix my problem.
 
X

XL-Dennis

Bala,

Perhaps a shot in the dark but have You checked that the add-in is not
disabled by MS Word?

Check it by choosing the command Help | About Microsoft Word |Disabled
Items...

Kind regards,
Dennis
 
H

Hans-Georg Michna

With .NET, is it still necessary to register the DLL on the
target machine, using regsvr32?

Hans-Georg
 
X

XL-Dennis

Hans-Georg,
With .NET, is it still necessary to register the DLL on the
target machine, using regsvr32?

It depends on which DLL Your refer to:

if the DLL is an unshimmed assembly then the appropiated solution would be
to use
regasm.exe.

If the DLL is an output of using the COM Shim wizard then it must be
registrated by using regsvr32 while the underlying assembly should not be
registrated at all.

Hopefully You will be able to understand the above. Otherwise post back.

Kind regards,
Dennnis
 
H

Hans-Georg Michna

Hans-Georg,
It depends on which DLL Your refer to:

if the DLL is an unshimmed assembly then the appropiated solution would be
to use
regasm.exe.

If the DLL is an output of using the COM Shim wizard then it must be
registrated by using regsvr32 while the underlying assembly should not be
registrated at all.

Hopefully You will be able to understand the above. Otherwise post back.

Dennis,

to be honest, I don't understand any of this. I've only written
an Office add-in with VB6, deliberately without .NET.

But don't bother, I don't have this acute problem, Bala does.
Perhaps he needs to do the registration.

Hans-Georg
 
B

Bala

Hi,

Thanks for the suggestion! However, the "add-in" is not disabled, so my
problem remains.
Furthermore, the COM Shim has been registered using "regsvr32.exe", so
this isn't the problem either.

I'm really puzzled by the fact that there is absolutely no output from
the add-in or from Word. It seems as if the add-in hasn't been
installed at all.

I would appreciate any suggestions for tackling this problem.

Thanks in advance,

Alke Wiebenga

PS:
Does anybody know if installing an Add-in for Office 2003 is any easier
than this?!


XL-Dennis schreef:
 
X

XL-Dennis

Hi Alke,

Hm, it seems to be a difficult one...

What are the security settings? Check it out via the command Tools |
Macro... | Security. If the Security level is High and Trust all installed
add-ins... on the Trusted Publisher tab is unchecked then the add-in will
never be loaded.

1.Test by setting the level to medium and check Trust all...
2. Close Word
3. Start Word.

What You can do is the following 'error'-trapping:
1. Add a messagebox to the OnConnection event
2. Add a messagebox to the OnDisconnection event
(Make sure that Your code for adding the buttons are not executed)

"Does anybody know if installing an Add-in for Office 2003 is any easier
than this?!" In my experience no...

Hans-Georg,
Check out my serie of post at Daily Dose of Excel, which is a walkthrough
about COM add-ins for Excel. It will be additional 5 post on the subject for
the coming weeks.

http://www.dailydoseofexcel.com/arc...managed-com-add-ins-with-vbnet-2005-part-iii/

Kind regards,
Dennis
 
B

Bala

Hi all (and particulary XL-Dennis),

Thanks for the prompt response! We seem to have solved our problem.

We tried to install the add-in on a "fresh" server today and everything
seemed to work fine! There seems to be something wrong with the other 2
servers I've tested the install on, so I may have searched for the
solution to my problem in the wrong area. I thought that the problem
was due to my deployment project, not due to the installed base on the
server itself.

What I've learned from all this:

Managed Add-in:
- Install the "Shared Add-in Support Update for the
Microsoft .NET Framework 2.0 (KB908002)".
- Download and install the Primary Interop Assemblies for your Office
version.
- Build a managed .NET add-in through the Visual Studio.NET Shared
Add-in wizard.
- Create a COM Shim project.
- Create a Deployment project (mind the checkbox for "Shared Add-in
support").

Deployment:
- Install the primary Interop Assemblies on the target server (or add
these to your deployment project).
- Install your own project (use your own deployment project).
- Make sure that the COM Shim is registered ("regsvr32.exe").

Start Word and wait for the magic to happen :)

Thanks everybody,

Bye!


XL-Dennis schreef:
 
X

XL-Dennis

Alke,

"Thanks for the prompt response! We seem to have solved our problem."

Great and a good start of the week!

Many thanks for providing a stepwise guide to create and deploy managed COM
add-ins. I believe it's important to carefully pay attention to these steps.

Hans-George,
From a production point of view I fully agree but sooner or later we will
all be using .NET so it's a question of when rather then why.

Kind regards,
Dennis
 

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