C
Cameron
I am having a problem with calling a method of my COM add-in from VB
in Word XP. The Add-in has been developed using ATL/MFC.
Here is what I'm doing.
Dim addIn As Object
Set addIn = Application.COMAddIns.Item("MyAddin")
MsgBox addIn.ProgID
addIn.Object.MyFunction ("Hello")
The call to addIn.ProgID works correctly, however the call to
addIn.Object.MyFunction causes a Run time error 91 'Object variable or
With block variable not set'. I have also tried to do
Dim addIn As Object
Set addIn = Application.COMAddIns.Item("MyAddin").Object
addIn.MyFunction ("Hello")
This does not work either. If I use the OLE viewer I can see the
function in the type libary. Can anyone help? Also is there an
example of such a add-in? I know of the example by Amit Dey, however
I am having problems getting this to compile under VS.NET 2003.
Cheers
Cameron
in Word XP. The Add-in has been developed using ATL/MFC.
Here is what I'm doing.
Dim addIn As Object
Set addIn = Application.COMAddIns.Item("MyAddin")
MsgBox addIn.ProgID
addIn.Object.MyFunction ("Hello")
The call to addIn.ProgID works correctly, however the call to
addIn.Object.MyFunction causes a Run time error 91 'Object variable or
With block variable not set'. I have also tried to do
Dim addIn As Object
Set addIn = Application.COMAddIns.Item("MyAddin").Object
addIn.MyFunction ("Hello")
This does not work either. If I use the OLE viewer I can see the
function in the type libary. Can anyone help? Also is there an
example of such a add-in? I know of the example by Amit Dey, however
I am having problems getting this to compile under VS.NET 2003.
Cheers
Cameron