Answered by:
Migration from Outlook2003 to Outlook 2010 - calling VBA procedures from VB script under custom form

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."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- Marked as answer by 许阳(无锡) Tuesday, December 18, 2012 6:33 AM
Monday, December 10, 2012 2:03 PM
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 -
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."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- Marked as answer by 许阳(无锡) Tuesday, December 18, 2012 6:33 AM
Monday, December 10, 2012 2:03 PM -
NOW its 11/2020
and Office 2019 is out
I wonder if it is now possible to start a VBA macro from OL 2019 Button in VBS?
Any news???
Saturday, November 14, 2020 8:15 PM