COM Connect

G

Goraya

Hi
I trying to connnect to a Comaddin using following code but evry time
I got an Exception object reference is not set to an object
instance.Here is the Code:

//Name of ComObject and wdApp represents MSWORD object
object objCom = "ALR.NETS.NetsWord.GL.Classes.NetsWord";
wdApp.COMAddIns.Item(ref objCom).Connect = true;

// This is second apporch
Type late = Type.GetTypeFromProgID("ALR.NETS.NetsWord.GL.Classes.NetsWord");
object obj = Activator.CreateInstance(late);
late.InvokeMember("NetsWord",BindingFlags.Default |
BindingFlags.InvokeMethod ,null,obj,null);

in both cases I got the same Exception.I am new to word
programming.Any help in this regard will be highly appriciated.......
 

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