Using the Script Editor

The Microsoft Script Editor allows you to add Microsoft Visual Basic Scripting Edition (VBScript) procedures that respond to events generated by items or form controls.

To run in developer mode

If you can see the Developer tab, you are running in developer mode. Otherwise, see Run in Developer Mode in Outlook to run in developer mode.

To open the Script Editor

  1. Open an item of the type to which you want to add code.

  2. On the Developer tab, in the Form group, click Design This Form.

  3. In the Form group, click View Code.

The Script Editor makes it easy to insert the template for an item event handler. To insert a blank item event handler

  1. On the Script menu, click Event Handler.

  2. Select the event you want to respond to, and then click Add.

The Script Editor can move the insertion point to a specific line of code. This makes it easy to debug the script when Microsoft Outlook reports an error at a specific location. To move to a specific line

  1. On the Edit menu, click Go To.

  2. In the Line Number box, type in the number of the line of code to which you want to go. Click OK.

Learn about he Outlook object browser.

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.