Sue Mosher [MVP] wrote on 01/28/2010 23:20 ET :
> 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?idT>
>
> "JMat45" wrote in message
> news:
>> 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?
>> I ask, therefore I am.
>>
>>
>
Dear Sue,
as a new member in this site I've met your answer regarding call VBA sub from
VBScript by using Application.MySub.
I tried it in Outlook 2007. The VBScript sub fires if I click a CommandButton.
The VBScript sub calls a Public sub in ThisOutlookSession by using
Application.MySub. But I get always a message that "This object doesn't
support this property or method: 'Application.Mysub' " (I re-translated the
message from Hungarian to English. Maybe the original one is a bit other).
Hiere is the VBScript content:
sub CommandButton4_Click
application.MySub
end sub
And here is the ThisOutlookSession module content (General):
Public Sub MySub()
MsgBox("Got it!")
End Sub
What I've made wrong?
Thnx for your answer in advance,
Zsolt