Calling a procedure in an addin

J

Jason Kontkanen

Hello,

I'm fairly certain I've seen an answer to this, but I can't find it. I've
written a COM addin (in visual basic) that goes in Word, Outlook, and Excel.
What I need is to call a function from an outside application. I was able
to find the addin walking through the COMAddins collection, but I can't call
any functions or read custom properties in it. What am I missing, or is it
even possible?

Thanks in advance,

Jason
 
K

Ken Slovak - [MVP - Outlook]

Use a public class or if you're using a designer declare public methods and
properties in the class or designer. Then you can access those public
methods or properties from other code.

In On_Connection set AddInInst.Object = Me.

In the external code (I typically use code like this to communicate between
the addin and a property page) I use code something like this:

Set oAddinBase = objOL.COMAddIns("MyAddin.Connect").Object.MyPublicClass
Call oAddinBase.MyPublicMethod
 
J

Jason Kontkanen

Ken,

Thanks for the pointer. When I saw what you said, that's what I remember
seeing. When I try it, though, I get a 438, "Object doesn't support this
property or method" Connect.IDTExtensibility2_OnConnection. This is coming
from word originally, I checked Outlook too and get the same error. From a
google, I found doing this: AddInInst.Object = Me (no set). This works.
Any idea why it'd be this way? I'm running Office 2000.


Jason
 
K

Ken Slovak - [MVP - Outlook]

Depends what language you're using. My example was a VBA/VB 6 style example,
with Set. VB.NET or C# would have different syntax for the same type of
example.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top