View Single Post
  #2  
Old November 17th 09, 06:10 PM posted to microsoft.public.outlook.program_addins
Duncan McNiven
external usenet poster
 
Posts: 2
Default Call add-in method from macro? SOLVED

After being stuck on this for days I hit on a solution.
In my OnConnection event in the Delphi code I put something like:

var
SelfDisp : OleVariant;
begin
SelfDisp := Self as IMyClassDisp;
OleVariant(AddInInst).Object := SelfDisp;

(IMyClassDisp is a descendant of IDispatch).
Then the IMyClassDisp methods included in the type library can be called from a macro using the same syntax I had tried earlier.

Just thought I would post this note in case anyone else finds this thread whilst stuck on the same problem.
Ads