Using VBScript behind Outlook forms with a COM-AddIn

  • Thread starter Justin Williams via OfficeKB.com
  • Start date
J

Justin Williams via OfficeKB.com

Hi,
I am trying to get the VBScript behind the Outlook forms (Outlook's
VBScript runtime) to work with my COM-AddIn so that I can develop
functionality with the COM-AddIn (in C#) and some of the other IT staff can
then script that functionality.

I have had good success so far and am able to call from the VBScript any of
the methods or properties from my COM-AddIn like so:

Set test = Application.COMAddIns.Item("Custom.COMAddIn").Object
MsgBox "This is a test: " & test.testMethod("1 2 3")

Where I'm stuck is communicating back to the VBScript from the COM object
to raise my events. In Windows Scripting Host, you'd create a VBScript
procedure that hooked into the events by naming the procedures the same
name as the event (Test_onClick, Test_onWhatever, etc). Given the lack of
documentation I've seen on the subject, I am wondering if Outlook's
VBScript can perform a similar way to handle events, or not?

If I can't handle events the "right" way, is there a workaround where I
could, say, raise the event for a hidden control on the Outlook form
(Changed or Click or something) so the VBScript doesn't have to continually
poll my COM-AddIn?

Any ideas or suggestions would be GREATLY appreciated!

Thanks!
-
Justin
 
K

Ken Slovak - [MVP - Outlook]

You certainly can handle events in Outlook forms. See
http://www.outlookcode.com/d/forms.htm for lots of information about Outlook
forms. I've communicated with addins from VBScript code but haven't gone the
other way and I don't know that it's possible.
 

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