
Visual Basic for Applications Unleashed

Chapter 21Web Page Programming: ActiveX and VBScript
Programming Web Pages with VBScript
HTML lets you create increasingly interactive and dynamic pagesfrom links to forms to database queries to ActiveX controls. Now that you know VBA, you can put that knowledge to good use by building some client-side intelligence into your pages. In other words, you can insert snippets of VBA-like code into your pages; this code will run automatically on users' machines when they download your page.
The secret of this is an offshoot of the VBA language called VBScript. In a browser that understands how to run VBScript programs (such as Internet Explorer), you can implement programs to validate form data, customize pages based on, say, the current time or the browser being used, get the various objects on the page to communicate with each other, and much more. These scripts (as they're called) can be as simple as displaying a message box when the user clicks a page object, to full-fledged games and applications. The rest of this chapter introduces you to VBScript, outlines the differences between VBA and VBScript, runs through the object hierarchy you have at your disposal, and shows you how to implement VBScript code in your Web pages.
Copyright © 1995-2008 Paul McFedries and Logophilia Limited
|