Accesing a comm addin instance from VB Script

  • Thread starter Gabriel Ciuloaica
  • Start date
G

Gabriel Ciuloaica

Hi,

I have a problem that I could not rezolve it. I have done an add-in in
VC++. The addin is working well. When I try to accees it from VB script
from a html page that is show by the OLK folder the Object property is
"Nothing" all the time.

Here is code from VB Script:
dim app
set app = window.external.OutlookApplication
dim addin
set addin = app.COMAddIns.Item("swyxClientOLK.swyxAddin")
dim ng1
set ng1 = addin.Object

ng1 is Nothing all the time.

What could be the problem ?

Thanks,
Gabi
 
K

Ken Slovak

I usually use something like this myself:

set ng1 = app.COMAddIns("swyxClientOLK.swyxAddin").Object

Not sure if that would make a difference for you...
 
G

Gabriel Ciuloaica

Ken said:
I usually use something like this myself:

set ng1 = app.COMAddIns("swyxClientOLK.swyxAddin").Object

Not sure if that would make a difference for you...
Hi Ken,

Thanks for the answer but it doesn't help me at all. COMAddIns Object
has a Item property that should be used to get the addin instance.
 
K

Ken Slovak

Did you even try what I suggested? I use the code I showed all the time
without Item and always get the COM addin object I want.
 
G

Gabriel Ciuloaica

Ken said:
Did you even try what I suggested? I use the code I showed all the time
without Item and always get the COM addin object I want.
Sure I've tryed. It shows me the following error:
"Wrong number of arguments or Invalid property assignment" for ComAddIns.

Thanks,
Gabi
 
G

Gabriel Ciuloaica

Gabriel said:
Sure I've tryed. It shows me the following error:
"Wrong number of arguments or Invalid property assignment" for ComAddIns.

Thanks,
Gabi

Anyway, I suspect that the problem is in the addin. In addin I have
multiple interfaces. If I use another interface from VBScript using
CreateObject() then the instance is created correctly for that interface
and I can call interface methods without a problem.

I suspect that the problem is in OnConnection method implementation in
VC addin code. The third parameter that is the AddinInstace is not saved
This could be the issue but I'm not sure.

Thanks,
Gabi
 
K

Ken Slovak

In that case you might have to use a separate addin for Outlook and not try
to mix it with support for other applications. In mixed use addins I've done
I have shared the same addin among Word, Excel and PPT but have always kept
my Outlook addins separate.
 

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