Creating Scriptlets

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

A scriptlet is an HTML code file that has either an .sct or an .htm extension. You can create scriptlets by using HTML code and Microsoft® Visual Basic® Scripting Edition (VBScript) code, Microsoft® JScript® code, or both, and you can create them in any HTML editor. In addition, you can create scriptlets by using the Microsoft Scriptlet Wizard. If you have worked with the Class Builder in Visual Basic version 5.0 or 6.0, you are already familiar with how this wizard works. The wizard takes you through the steps required to create the basic HTML code required for a scriptlet, along with a sample container file containing the HTML code required to reference the scriptlet from another Web page. You can download the Scriptlet Wizard from the Microsoft Scripting Technologies Web site at http://msdn.microsoft.com/en-us/library/ms950396.aspx.

What Kind of Scriptlet Should I Create?

There are two basic types of scriptlets: those that have a user interface (DHTML scriptlets) and those that do not (code-only scriptlets). Scriptlets that have a user interface are encapsulated script and DHTML code and are designed to display their user interface in another HTML page. For example, you could create a scriptlet that displays a digital clock or a calendar. The display elements and all the code necessary to make the display work properly are encapsulated within the scriptlet so that it can be used again and again just like any other COM component.

Scriptlets without a user interface are Web pages in which script procedures have been written so that these procedures behave like methods and properties of an object. This type of scriptlet is analogous to a custom object created from a VBA class module. Like a class module, the scriptlet contains a number of procedures, some of which are exposed to other objects as methods or properties and others that are accessible only by other procedures within the scriptlet itself.

The reasons for creating reusable objects that contain script are the same as the reasons for creating reusable objects through Visual Basic for Applications (VBA).

See Also

Working with Office Web Discussions Client | Enabling Discussions | Understanding the Global Object | Understanding Discussion Servers | Understanding Discussions | Understanding Subscriptions | Custom Classes and Objects