Outlook custom form - VBS call VBA macro

Discussion in 'Microsoft Outlook Form Programming' started by JMat45, Jan 29, 2010.

  1. JMat45

    JMat45 Guest

    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.
     
    JMat45, Jan 29, 2010
    #1
    1. Advertisements

  2. 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" <> wrote in message
    news:D...
    >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.
     
    Sue Mosher [MVP], Jan 29, 2010
    #2
    1. Advertisements

  3. JMat45

    JMat45 Guest

    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" <> wrote in message
    > news:D...
    > >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.

    >
    >
    > .
    >
     
    JMat45, Feb 1, 2010
    #3
  4. JMat45

    JMat45 Guest

    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" <> wrote in message
    > > news:D...
    > > >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.

    > >
    > >
    > > .
    > >
     
    JMat45, Feb 1, 2010
    #4
  5. JMat45

    mtilton

    Joined:
    Jan 11, 2012
    Likes Received:
    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
     
    mtilton, Jan 11, 2012
    #5
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kevin Davison

    How to change form tab using VBS

    Kevin Davison, Jul 14, 2003, in forum: Microsoft Outlook Form Programming
    Replies:
    0
    Views:
    683
    Kevin Davison
    Jul 14, 2003
  2. Christoph Sbach

    Mini Problem: A custom mail-form create a custom task-form

    Christoph Sbach, Nov 4, 2003, in forum: Microsoft Outlook Form Programming
    Replies:
    4
    Views:
    752
    Hollis D. Paul
    Nov 5, 2003
  3. motiv8d

    custom message form recieved without custom fields - outlook 2000

    motiv8d, Mar 5, 2004, in forum: Microsoft Outlook Form Programming
    Replies:
    0
    Views:
    638
    motiv8d
    Mar 5, 2004
  4. Guest

    Call a COM Addin method from a custom Outlook Form?

    Guest, Oct 12, 2004, in forum: Microsoft Outlook Form Programming
    Replies:
    0
    Views:
    359
    Guest
    Oct 12, 2004
  5. rm

    Custom Form w/ DB Call

    rm, Mar 8, 2007, in forum: Microsoft Outlook Form Programming
    Replies:
    0
    Views:
    231
  6. Naval kishore

    How to create and call Microsoft Custom Form in Outlook 2003 Mail?

    Naval kishore, May 8, 2008, in forum: Microsoft Outlook Form Programming
    Replies:
    1
    Views:
    1,342
    Sue Mosher [MVP-Outlook]
    May 8, 2008
  7. Bert_Bert

    Is it possible tse my VB procedure in Form VBS script ?

    Bert_Bert, Sep 2, 2008, in forum: Microsoft Outlook Form Programming
    Replies:
    2
    Views:
    335
    Bert_Bert
    Sep 5, 2008
  8. Sharon Wright

    Custom VBA forms in Outlook--how to call w/macro?

    Sharon Wright, Jun 9, 2009, in forum: Microsoft Outlook Form Programming
    Replies:
    1
    Views:
    2,352
    Ken Slovak - [MVP - Outlook]
    Jun 9, 2009
Loading...