Microsoft KB Archive/167138

= OL97: General Information About Using VBScript with Outlook =

Article ID: 167138

Article Last Modified on 8/27/2007

-

APPLIES TO


 * Microsoft Outlook 97 Standard Edition

-



This article was previously published under Q167138





SUMMARY
This article provides general information about using Visual Basic Scripting Edition (VBScript) with Microsoft Outlook 97.



MORE INFORMATION
This article discusses the following topics:
 * Overview
 * VBScript Version History
 * How to Determine Your Version of VBScript
 * How to Obtain VBScript Version 3.0 and Its Documentation
 * How to Debug VBScript Programming Code
 * Deploying VBScript with an Outlook Solution

Overview
VBScript is the programming language that you use to create custom form solutions with Outlook 97. Microsoft Internet Explorer also uses VBScript to create custom HTML page solutions.

VBScript is a subset of the commands available in Microsoft Visual Basic for Applications in Office 97, which in turn is a subset of the commands available in Microsoft Visual Basic 5.0.

In Outlook, VBScript is stored within Outlook items, such as a contact, mail message, or appointment. There is no global repository for VBScript code in Outlook as there is with other Office applications. All programming from within Outlook involves creating a custom form. You can also automate Outlook from another Visual Basic or Microsoft Office application by using the object model of Outlook; however, the object model is heavily based on Outlook items and folders.

Outlook's implementation of VBScript is by design and there are no current plans to implement Visual Basic for Applications within Outlook. VBScript is Microsoft's programming environment for all "enterprise" (or "distributed") solutions, mainly for two reasons:
 * Because VBScript code is interpreted and not compiled, Outlook items are relatively small (in terms of bytes). This means they consume less corporate and Internet server resources and also result in faster performance.
 * VBScript is designed to be a secure programming environment. It lacks various commands that can be potentially damaging if used in a malicious manner. This added security is critical in enterprise solutions.

VBScript Version History
  Version   Availability                 Notes ---  --   -   1.0       Included with Outlook versions 8.0 - 8.04

2.0      No longer available for      The self-installing executable Download. Included with     filename was Scr20en.exe. Added with Internet Information   features included arrays, the Server (IIS) 2.0. For Each...Next structure, and GetObject/CreateObject commands.

3.0      Installed by Internet        See the following Web site for Explorer 4.0                all current information: http://www.microsoft.com /scripting/vbscript 3.1      Installed by Internet Explorer 4.1

3.1a     Download only                http://www.microsoft.com/ /scripting/vbscript

How to Determine Your Version of VBScript
To determine which version of VBScript you have, follow these steps:  On the Windows taskbar, click the Start button, point to Find, and then click Files Or Folders. In the Named box, type vbscript.dll, and then click Find Now. Using the right mouse button, click the Vbscript.dll file name in the Name list, and on the shortcut menu, click Properties.  Click the Version tab and note the "File version" information.    VBScript   DLL version   File Date   File Size ---   1.0        1.0.0.806     (varies)    206,848 bytes 2.0       2.0.0.1125    (varies)    252,232 bytes 3.0       3.0.0.2026    9/18/97     327,952 bytes 3.1       3.1.0.2124    11/18/97    328,976 bytes 3.1a      3.1.0.2430    12/30/97    328,976 bytes 

How to Obtain VBScript 3.x and Its Documentation
VBScript 3.x is installed as part of Microsoft Internet Explorer 4.x, which is available from the Microsoft Web site at the following address:

http://www.microsoft.com/windows/ie/downloads/default.mspx

Documentation for VBScript 3.x is available from the following address:

http://www.microsoft.com/technet/scriptcenter/default.mspx

How to Debug VBScript Programming Code
Outlook 97 provides no built-in debugging tools for troubleshooting programming problems. However, you can get debugging functionality by using the VBScript debugger which is commonly used with Internet Explorer.

Free, unsupported beta versions of debuggers are available on the Microsoft Web site at the following address:

http://www.microsoft.com/scripting/debugger

For VBScript version 1.0 or 2.0, use the debugger for Internet Explorer 3.x. For VBScript versions 3.x, use the debugger for Internet Explorer 4.0.

To access the debugger from Outlook, place a Stop statement in your VBScript code. When the VBScript code runs and reaches the Stop statement, the debugger starts, and you can then step through your code in the debugger or use the debugger's Immediate or Command window to view the contents of variables ("? <Variablename>" is the syntax). Note that you cannot edit the VBScript code within the debugger.

Deploying VBScript with an Outlook Solution
If an Outlook solution uses any commands specific to VBScript version 2.0 or 3.x, you must install the updated version of VBScript on all of the computers that will use the solution.

Outlook primarily uses Vbscript.dll, but the complete set of scripting DLLs also include Jscript.dll, and Scrrun.dll.

<div class="references_section">