Execute code behind a form via VBA Automation

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.)
 
S

Sue Mosher [MVP-Outlook]

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.
 
D

dch3

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.)
 
D

dch3

Which of course means that I misunderstood the response...

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

Thanks.
 
S

Sue Mosher [MVP-Outlook]

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
 

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