Outlook custom form - VBS call VBA macro


J

JMat45

I have created a custom OL form based on the Contact form. I want to save
data from some of the fields to a text file. I want to initiate the save
using the WRITE event. I have written the SUB in VBA to save the data, but
can't call the SUB from the form VBS. What is the solution or workaround?
 
Ad

Advertisements

S

Sue Mosher [MVP]

If the Sub is a public Sub in the built-in ThisOutlookSession module, it
should be possible to call it as Application.MySub or whatever its name
is. --
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54
 
Ad

Advertisements

Joined
Jan 11, 2012
Messages
1
Reaction score
0
Hi,

I am unable to get this to work. My Outlook macro is called "Public Sub TestBCM()" and is in the ThisOutlookSession module. It just consists of a MsgBox. In VBS, I have the following code:

Set objOutlook = CreateObject("Outlook.application")
objOutlook.Application.TestBCM

I also tried just "objOutlook.TestBCM" on the second line. Neither worked. Anyway, if Sue or someone else has ideas about how I can get the code working, please let me know! Thanks very much.

Meg
 

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