Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

Chapter 13: Adding Scripting Support to Your Application

Visual Studio 6.0

Buy this book

  • The MSScript control

  • VBScript programming

  • A programmable calculator

  • Equation calculations in a spreadsheet

Do you want to allow your users to customize their copies of your application? Would you like to let your users automate repetitive tasks? Is there a need for a scripting language in your application? Are you interested in putting a really cool feature in your application? If you answered yes to any of these questions, then your application really needs MSScript.

MSScript began life as VBScript—a lightweight version of Visual Basic designed to compete with JavaScript in web browsers. Today, the MSScript ActiveX control is used to provide general-purpose scripting services within an application. The MSScript control supports both VBScript and JavaScript scripting languages. Since I’m somewhat biased, I’m going to focus on how to use VBScript and not bother with JavaScript. The same techniques I discuss here apply to JavaScript as well. Only the actual scripting code used will differ.

In this chapter, I will build two new programs: a simple program that allows you to test functions in VBScript and a really programmable calculator. I’m also going to revisit the Charter program and add the ability to perform simple calculations using the MSScript control (also known as the ScriptControl).

NOTE: VBScript is not Visual Basic for Applications. It is important not to confuse VBScript and Visual Basic for Applications (VBA). VBA is included with products like Microsoft Word and Microsoft Excel, and it is a much richer language than VBScript. VBA has a more sophisticated development environment than VBScript. It is possible to develop complete applications using VBA. VBScript, on the other hand, is designed primarily as a macro language and is not very suitable for developing applications.

© 1998 SYBEX Inc. All rights reserved.

© 2015 Microsoft