I've been playing around with this for a bit and it doesn't seem possible.

According to help we should be able to retrieve a pointer to IDispatch using $com(ie,Document,3,dispatch*%doc) and then use $com(%doc,Body,3,dispatch*%body) and so on... to navigate the object heirarchy.

I made a simple VB COM object to test this. I have two classes Class1 and Class2. Class2 is a private member of Class1.

Class2 is very simple and has one property which returns a BSTR


Class1
===========
Private m_Class2 As Class2
Public Property Get Class2() As Class2
If m_Class2 Is Nothing Then
Set m_Class2 = New Class2
End If

Set Class2 = m_Class2
End Property
==========

Class2
==========
Public Property Get Val() As String
Val = "Hello"
End Property
==========

Now the script code:

alias ct {
comopen ct mIRCTest.Class1

echo -s Dispatch pointer: $com(ct).dispatch
echo -s Calling Class2: $com(ct,Class2,3,dispatch*%CL2)
echo -s Calling Val: $com(%CL2,Val,3)
echo -s Val is: $com(%CL2).result
comclose %CL2
comclose ct
}

It looks like %CL2 is never being created. Now what would be cool is a function that would act like the following

comopen Body $comGet(ct,Document.Body)

$comGet would parse the string and make the QI calls and build the objects for us. It would make this easy.

Until this is confirmed as a bug and fixed or a solution is found you could always write a really simple COM object in VB

Good luck