Outlook custom form - VBS call VBA macro

  • Thread starter Thread starter JMat45
  • Start date Start date
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?
 
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
 
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
 
Back
Top