MS Project 2002 Addin and jscript

  • Thread starter Pascal Lenormand
  • Start date
P

Pascal Lenormand

Hi,

I did an AddIn for the MS Project 2002 in C#.
In this addin, I add a new HTML page in the left side pane.
In this html page, I have jscript code where I want to call a method of
my C# addin.

Here is what I tried :

function RunProjectPlan()
{
var application = window.external.application;
var addin = application.COMAddIns("Addin.Connect");
if (addin) {
var name = addin.GetName();
}
}

At runtime, I've got the error :
Object doesn't support this property or method.

Here is the C# class for my addin :
namespace Addin {
[InterfaceType(ComInterfaceType.InterfaceIsDual)]
public interface ConnectInterface {
void DisplayMessage();
string GetName();
}

[GuidAttribute("5D921954-FA0E-491F-AAA1-D27230DA3D29"),
ProgId("Addin.Connect")]
[ClassInterface(ClassInterfaceType.AutoDual)]
public class Connect : Object, Extensibility.IDTExtensibility2,
ConnectInterface
{
....
}
}

One more information. I tried to call this method in an other
application which has this COM component as reference, and the method is
called.

What am I doing wrong ?

Thanks for your help.
Pascal Lenormand
 
Z

Zack Halbrecht

Hi. I am having the same problem.
If anyone has a solution to this it would be much appreciated.
 
Z

Zack Halbrecht

OK.

Got a solution here in the Jscript...

application.COMAddIns.Item("Addin.Connect").Object.GetName();
 

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