Accesing a comm addin instance from VB Script

  • Thread starter Thread starter Gabriel Ciuloaica
  • Start date 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
 
I usually use something like this myself:

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

Not sure if that would make a difference for you...
 
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.
 
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.
 
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
 
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
 
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.
 
Back
Top