PC Review


Reply
Thread Tools Rate Thread

Outlook custom form - VBS call VBA macro

 
 
JMat45
Guest
Posts: n/a
 
      29th Jan 2010
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.
 
Reply With Quote
 
 
 
 
Sue Mosher [MVP]
Guest
Posts: n/a
 
      29th Jan 2010
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


"JMat45" <(E-Mail Removed)> wrote in message
news(E-Mail Removed)...
>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.



 
Reply With Quote
 
 
 
 
JMat45
Guest
Posts: n/a
 
      1st Feb 2010
Ok, I will give that a try. Thanks for the advice.
--
I ask, therefore I am.


"Sue Mosher [MVP]" wrote:

> 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
>
>
> "JMat45" <(E-Mail Removed)> wrote in message
> news(E-Mail Removed)...
> >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.

>
>
> .
>

 
Reply With Quote
 
JMat45
Guest
Posts: n/a
 
      1st Feb 2010
Sue, worked great. I'm back in business. Thanks very much.
--
I ask, therefore I am.


"JMat45" wrote:

> Ok, I will give that a try. Thanks for the advice.
> --
> I ask, therefore I am.
>
>
> "Sue Mosher [MVP]" wrote:
>
> > 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
> >
> >
> > "JMat45" <(E-Mail Removed)> wrote in message
> > news(E-Mail Removed)...
> > >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.

> >
> >
> > .
> >

 
Reply With Quote
 
New Member
Join Date: Jan 2012
Posts: 1
 
      11th Jan 2012
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
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom VBA forms in Outlook--how to call w/macro? Sharon Wright Microsoft Outlook Form Programming 1 9th Jun 2009 06:46 PM
How can i include a .vbs file in another .vbs file Store a reference of a excel workbook Microsoft Excel Programming 3 3rd Mar 2009 07:56 PM
Same code in VBS file and VB.NET Assembly - VBS works but VB.NET fails Raghu Microsoft VB .NET 2 31st May 2005 10:12 PM
Re: VBS scripts : how to check is the client can use .vbs ? Conrad Lawes Microsoft Windows 2000 Deployment 1 18th Jul 2003 11:57 AM
Re: VBS scripts : how to check is the client can use .vbs ? Gerry Hickman Microsoft Windows 2000 Deployment 2 16th Jul 2003 09:13 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:10 AM.