none
Migration from Outlook2003 to Outlook 2010 - calling VBA procedures from VB script under custom form RRS feed

  • Question

  • Our custom forms developed in Outlook 2003 and located in Public folders call public VBA procedures in ThisOutlookSession.

    For example:

    A custom form with "Hello World" button has the following code in VB Script code under the form :

    Sub buttonHelloWorld_Click()

      Application.subHelloWorld

    End Sub

    This VB script calls the following procedure in the Outlook VBA project  ThisOutlookSession:

    Public Sub subHelloWorld()

      MsgBox "Hello world!"

    End Sub

    After migration to Outlook 2010, the VBScript calls for the VBA procedures in the  ThisOutlookSession no more work. I can run the subHelloWorld as a macro from Developer/ Macros menu. The macro execution is allowed. Code behind forms in Public folders is allowed. The VBA code is digitally signed.

    Why does not the Application.subHelloWorld work any more? I heard general advices about convering the VBA into Add-ons and using form regions. It will take me a long time and tremendous effort to do that. Please, tell me there is another simple way like changing some default Outlook property setting. Thank you.

    Friday, December 7, 2012 9:18 PM

Answers

  • Calling procedures in ThisOutlookSession from outside was never supported. It worked, but always with the caution that it might not in the future. That time has arrived. You need to use a COM addin and communicate with that from the outside, or come up with something else.

    --
    Ken Slovak
    [MVP-Outlook]
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
    "Workaholik1" <=?utf-8?B?V29ya2Fob2xpazE=?=> wrote in message news:20cd6e14-2179-4591-b792-d9f5b81f9ccb...

    Our custom forms developed in Outlook 2003 and located in Public folders call public VBA procedures in ThisOutlookSession.

    For example:

    A custom form with "Hello World" button has the following code in VB Script code under the form :

    Sub buttonHelloWorld_Click()

      Application.subHelloWorld

    End Sub

    This VB script calls the following procedure in the Outlook VBA project  ThisOutlookSession:

    Public Sub subHelloWorld()

      MsgBox "Hello world!"

    End Sub

    After migration to Outlook 2010, the VBScript calls for the VBA procedures in the  ThisOutlookSession no more work. I can run the subHelloWorld as a macro from Developer/ Macros menu. The macro execution is allowed. Code behind forms in Public folders is allowed. The VBA code is digitally signed.

    Why does not the Application.subHelloWorld work any more? I heard general advices about convering the VBA into Add-ons and using form regions. It will take me a long time and tremendous effort to do that. Please, tell me there is another simple way like changing some default Outlook property setting. Thank you.


    Ken Slovak MVP - Outlook
    Monday, December 10, 2012 2:03 PM
    Moderator

All replies

  • Hi Workaholik1,

    Thanks for posting in the MSDN Forum.

    Would you plese tell me the detailed scenario for move your custom form from 2013 to 2010? Let's see whether there has missed something.

    Have a good day,

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, December 10, 2012 10:09 AM
    Moderator
  • Calling procedures in ThisOutlookSession from outside was never supported. It worked, but always with the caution that it might not in the future. That time has arrived. You need to use a COM addin and communicate with that from the outside, or come up with something else.

    --
    Ken Slovak
    [MVP-Outlook]
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
    "Workaholik1" <=?utf-8?B?V29ya2Fob2xpazE=?=> wrote in message news:20cd6e14-2179-4591-b792-d9f5b81f9ccb...

    Our custom forms developed in Outlook 2003 and located in Public folders call public VBA procedures in ThisOutlookSession.

    For example:

    A custom form with "Hello World" button has the following code in VB Script code under the form :

    Sub buttonHelloWorld_Click()

      Application.subHelloWorld

    End Sub

    This VB script calls the following procedure in the Outlook VBA project  ThisOutlookSession:

    Public Sub subHelloWorld()

      MsgBox "Hello world!"

    End Sub

    After migration to Outlook 2010, the VBScript calls for the VBA procedures in the  ThisOutlookSession no more work. I can run the subHelloWorld as a macro from Developer/ Macros menu. The macro execution is allowed. Code behind forms in Public folders is allowed. The VBA code is digitally signed.

    Why does not the Application.subHelloWorld work any more? I heard general advices about convering the VBA into Add-ons and using form regions. It will take me a long time and tremendous effort to do that. Please, tell me there is another simple way like changing some default Outlook property setting. Thank you.


    Ken Slovak MVP - Outlook
    Monday, December 10, 2012 2:03 PM
    Moderator