Execute code behind a form via VBA Automation

  • Thread starter Thread starter dch3
  • Start date Start date
D

dch3

I have a custom form with several command buttons each with their own script.
I'm building some automation from outside of Outlook to create a new item
using the custom form. As a part of the automation, I'll need some of the
scripts to execute.

What syntax do I use to call the specific script?

I can instantiate the new item without any problems and set the various
fields (eg. TO, FROM, SUBJECT, etc.)
 
It is not possible to call a custom form's VBScript code from VBA. The only
form script that you can force to run is that in Item-level event handlers.
For example, if you change the value of the Subject property, any code in the
form's Item_PropertyChange procedure will run.
 
Oh the humanity

(I'm in a bit of a mood due to an unexpcted, minor, but annoying issue
that's cropped with one of my apps.)
 
Which of course means that I misunderstood the response...

So basically add something to Item_PropertyChange() which CALLs the code.

Thanks.
 
Yes. If the VBA code changes the value of any standard property, whatever
code you have set to run in the Item_PropertyChange event handler will
execute.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
 
Back
Top