This page has been archived and is no longer  being actively maintained.
Outlook Developer Home
Outlook Programmer's Library
 
Outlook Technologies
Outlook Forms
Languages
Samples
Other Technologies

 

VBScript in Outlook Development

For the current version of this page, click here.

The code behind Microsoft Outlook forms is always written with the Microsoft Visual Basic Scripting Engine, better known as VBScript, a small portable language, which is also used in web pages and standalone scripts. VBScript is included with Internet Explorer. I strongly recommend that you download the basic VBScript documentation and keep it handy, since Outlook itself includes no documentation on VBScript functions, methods and objects. 

Versions | Documentation | Tutorials | Tips | Windows Script Host | Samples | More Information

Versions

VBScript generally is updated with each new version of Microsoft Internet Explorer. For a version history, see:

Versions earlier than 2.0 do not support intrinsic VB constants or the Split() and Join() functions that make it extremely easy work with Outlook's Categories property. Older versions also do not support the FileSystemObject for accessing files and folders.

Back to Top

Documentation

Scripting Runtime Library
Regular expressions
Back to Top

Tutorials

Back to Top

Tips

VBScript Does Not Support the Built-in Constants -- Get them from the object browser. Press ALt+F11 to open the VBA environment in Outlook, then press F2. Or use the list from Microsoft Outlook 2002 Object Model Constants.

You can use the Microsoft Script Debugger to debug Outlook form scripts. For Outlook 2000, you'll need to download it; see Microsoft Windows Script Debugger. For Outlook 2002 and 2003, make sure you install the HTML Source Editing / Web Scripting / Web Debugging component listed under Office Tools when you do a custom setup or add components. One way to force a script to invoke the debugger is to put a Stop statement in the code. You can also open an item using a custom form, choose Tools | Forms | Script Debugger, and then set breakpoints.

Back to Top

Windows Script Host

Windows Script Host (WSH) lets you run Visual Basic (or Java) script directly within Windows. For basics, see:

If you have WSH installed, you can launch any other program with VBScript code like this: 

You can also access the registry with WSH, something VBScript cannot do by itself. See:

Other handy WSH techniques:

  • Popup - Display a message to the user and wait for a button press or a timeout
Back to Top

Samples

Back to Top

More Information

Scripting support sites
   
© 2002-6 TurtleFlock, LLC
All right reserved.
About OutlookCode.com

Send comments to webmaster@outlookcode.com

Designed and Implemented by TerraLink USA 

FrontPage Integration
by RobsonDesignWorks

 
 
get Sue's code | forums | share your own code | registration