A Web script is a type of computer code that can be used to make your Web page dynamic. For example, a Web script could be used to include a "number of visitors" counter that increments each time someone visits your Web page. Or a Web script could be used to include a countdown to a special event: "only x more days", where x decreases by 1 every day. Usually Web scripts are run by a Web browser when a Web page is opened, typically to display information produced by the script. Creating Web scripts is an advanced Office feature that requires programming knowledge. You can add Microsoft Visual Basic Scripting Edition (VBScript) or JavaScript to your page in Microsoft Word, Excel, PowerPoint, and FrontPage.
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 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) on your page.
You view and edit the HTML code, along with any script code for your Web page, using the Microsoft Script Editor. 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.
Tips
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 Web toolbar 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.