Need help with ADXRemoteObject

Add-in Express™ Support Service
That's what is more important than anything else

Need help with ADXRemoteObject
how to use method CallMethod in VBScript context? 
Thomas Guenther




Posts: 94
Joined: 2006-02-20
Hi!

I developed a COM-AddIn for Outlook 2000 and Outlook 2003 with AddIn-Express.NET 2.6.

I referenced the COM-AddIn in an custom OutlookForm via VBScript-Code
(Application.COMAddins.Item("MyOlPluginShim.Proxy").object).
As expected a got back a reference to ADXRemoteObject which has some methods like GetProperty, SetProperty and CallMethod.
I can get the GetProperty-method to work in my VBScript but i need to call some methods from my COM-AddIn, some with and some without parameters.

But i can't get it to work. The method CallMethod needs two parameters:
string name for the method name i like to call (hope so....) and an array of objects (object[]).

How i have to set object[] if i have a method without parameters?
How i have to set object[] if i have a method with parameters?

I didn't found any documentation or example how to use the methods of ADXRemoteObject.....

THANX for your help!!!


Ciao
Thomas
Posted 06 Jul, 2006 02:33:03 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Thomas.

Please try the code below.

Sub ADXRemoting()
Dim remoteObj As Object
Dim args(1) As Variant

Set remoteObj = Application.COMAddIns.Item("MyShimmedAddinShim.Proxy").Object

MsgBox (remoteObj.GetProperty("MyProperty"))

args(0) = "parameter 1"
args(1) = "parameter 2"
MsgBox (remoteObj.CallMethod("MyMethodWithParameters", args))

End Sub

How i have to set object[] if i have a method without parameters?

I am afraid, now it is not possible. I will add a new 'CallMethod' member without parameters in the next ADX build.
Posted 06 Jul, 2006 08:54:23 Top
Thomas Guenther




Posts: 94
Joined: 2006-02-20
Hi Sergey!

1000 THANX for your help and code snipped !
It worked great in VB6 (i forgot to define the array as Variant)! :D

Even in VBScript it doesn't work because i cannot initialize arrays of a specific type (or missed i something...?).

But i can call the COM-AddIn in my VB6 component and then read the result in my VBScript from the component.

I can set a dummy parameter in my function unless a new method is added to the ADXRemoteObject class.

:)

Best regards and thanx again,
Thomas
Posted 06 Jul, 2006 09:42:53 Top