Developing Office COM Add-In using .Net

R

roytang

Hi,

I'm not sure if this is the proper forum to ask. If not, kindly
redirect me to the proper forum.

We're working on a COM add-in for office (powerpoint in particular)
using C#.Net. We followed the tutorial in http://support.microsoft.com/kb/302901

It works fine when developing on a machine with Visual Studio 2005
installed. The problem is when we deploy the program to a clean
machine (using the setup program generated by the wizard), the
additional menu items we create don't appear in Powerpoint - as if the
add-in is not being loaded at all.

I checked the registry, and the add-in is indeed registered under
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerPoint\AddIns, and the
Program id there maps to a valid ProgId/CLS_ID pair...I'm not sure
what else to check. Any advice would be greatly appreciated.

Thanks,

Roy
 
M

Mousam

Hi,

I'm not sure if this is the proper forum to ask. If not, kindly
redirect me to the proper forum.

We're working on a COM add-in for office (powerpoint in particular)
using C#.Net. We followed the tutorial inhttp://support.microsoft.com/kb/302901

It works fine when developing on a machine with Visual Studio 2005
installed. The problem is when we deploy the program to a clean
machine (using the setup program generated by the wizard), the
additional menu items we create don't appear in Powerpoint - as if the
add-in is not being loaded at all.

I checked the registry, and the add-in is indeed registered under
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PowerPoint\AddIns, and the
Program id there maps to a valid ProgId/CLS_ID pair...I'm not sure
what else to check. Any advice would be greatly appreciated.

Thanks,

Roy

Hi Roy,
Just check if the .NET framework is installed on the testing
machine and if it is installed, whether PowerPoint is pointing to the
correct version of .NET framework or not. You can find details on the
following link (Read the comments at the end of the article)

http://www.codeproject.com/dotnet/excelnetauto.asp

Though the article is about Excel, but I guess same things must be
applicable to all office applications.

Thanks & Regards,
Mousam Dubey
 
R

roytang

I think I found the problem. Apparently I need to include the
extensibility assembly in the installer program, and now when I put a
messagebox alert in the Connect and OnConnection functions, the alert
is shown when starting up PowerPoint so I know the add-in is loaded
correctly. However, a similar alert in OnStartupComplete does not
execute, and that's where I add my menu entries, etc. Any idea? Does
it mean that Powerpoint failed to load the add-in completely?
 
R

roytang

Posting the solution here for reference by people in the future. (It
was hard to find it)

Apparently, you are not allowed to access the CommandBars property of
the applicationObject directly - doing so causes the entire function
to be ignored completely. You need to access the CommandBars by
reflection, i.e.:

oCommandBars =
(CommandBars)applicationObject.GetType().InvokeMember("CommandBars",
BindingFlags.GetProperty , null, applicationObject ,null);
 

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