Calling a Public sub-routine from the script editor via VB script

Outlook version
Outlook 2016 32 bit
Email Account
Exchange Server
#1
I have a public subroutine called "Forward". This is located within the "Thisoutlooksession" class module .
I am trying to call this code using a command button via the script editor.
I have not done this before. Therefore, any help in this regard would be a great help to me.
 
Outlook version
Outlook 2016 32 bit
Email Account
Exchange Server
#3
Thanks a lot Diane for replying back. For some reason, the code below is not working.

Private CommandButton3_Click()

complete

End sub


Do we use private subs in the Outlook VB script editor? I am fairly new to the outlook script editor. So, if this question sounds silly, please excuse me.

If I may digress a little bit, can you please guide me with the code to "forward" an email. I want to place it behind a command button within one of my custom forms.

Looking forward to your guidance.
 

Michael Bauer

Senior Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server
#5
You can try this syntax
Code:
ThisOutlookSession.Forward
If that doesn´t work either, it´s probably blocked for security reasons. An alternative would be to move the method to a module (not a class module).
 

Similar threads

Top