Scripting is useful for custom Web-based solutions development. It provides a full object model for the Web browser and the objects on the current page. This makes it easy to write code that manipulates elements on the page without you knowing the details of the HTML (HTML: The standard markup language used for documents on the World Wide Web. HTML uses tags to indicate how Web browsers should display page elements such as text and graphics and how to respond to user actions.) or how the objects are implemented. You can also create script code that is specifically designed to handle events that occur on objects (such as ActiveX controls (ActiveX control: A control, such as a check box or button that offers options to users or runs macros or scripts that automate a task. You can write macros for the control in Microsoft Visual Basic for Applications or scripts in Microsoft Script Editor.)) on your page.
You view and edit the HTML code, along with any script code for your Web page, using the Microsoft Script Editor (Microsoft Script Editor: Used to add text, edit HTML tags, and edit any Microsoft Visual Basic Scripting Edition (VBScript) code in a data access page. You can also view your page in the Script Editor as it would appear in a Web browser.). In the Script Editor, you can add text, edit HTML tags, and edit any Web script code. You can also view your Web page as it would appear in a Web browser and edit it in this view. For detailed information about creating scripts, see Microsoft Script Editor Help.
- When you insert a script in a Web page in an Office program, the Script Editor creates a separate copy of the page you are editing, containing your content along with the script code. After editing the page in the Script Editor and returning to the Office program, click Refresh on the Refresh toolbar (toolbar: A bar with buttons and options that you use to carry out commands. To display a toolbar, press ALT and then SHIFT+F10.) to update the original page with the changes you made in the Script Editor.
- Be careful when copying and moving Web scripts. Although some are self-contained and work correctly in any location on any page, other Web scripts are dependent on the structure of the Web page they are in. When copied or moved to another Web page — or to another location on a Web page — these scripts might not run correctly or might return errors when viewed in a browser.