How to Add Scripts to Word Documents

How to Add Scripts to Word Documents thumbnail
Adding scripts in Word can be done via Microsoft Script Editor.

Scripting is a programming language in which the programs that are created are a collection of commands that are inferred and then executed one after another. To add scripts within Microsoft Word, you must use the Microsoft Script Editor (MSE) add-on. The Scripts collection in MSE holds the Script objects in an Office document. A Script object represents a tag pair, its settings, and all the text that lies between the tag pair. A Word document can contain numerous script blocks, and each block can have any number of procedures.

Things You'll Need

  • Microsoft Script Editor
  • Microsoft Word
Show More

Instructions

    • 1

      Open Word and open the Script Editor. This is part of Office and included in Word. Open Script Editor in Office 2000 or 2003 by opening the "Tools" menu, point to macros and select "Script Editor." If you are running Office 2007, click the "Office" button and clicl "Excel Options." Go to the "Popular" tab and select the "Show Developer tab" in the ribbon.

    • 2

      Add script to the Word document. Do this by utilizing the Scripts collection's "Add" method. This method uses elective arguments that can specify the script's ID attribute, language, location, additional tag attributes, and the script to contain itself within the "<SCRIPT>" tags. Using the "Add" method automatically creates HTML tags around the script you wrote so that browsers that do not read script ignore it.

    • 3

      Use the "Anchor" argument within the "Add" method to identify where the "Script" object should be put in the document. When scripting in Word, if a value is not specified for the "Anchor" argument, the "Script" object is inserted at the current location of the cursor.

    • 4

      Specify the "Script" object to a "Selection" object or an "InLineShape" object. If you put a "Selection" object in the "Anchor" argument, the "Script" object will be put at the end of the "Selection" object. But if you specify an "InLineShape" object in the "Anchor" argument, the "Script" object is placed before the marker of the paragraph so that the paragraph that is the anchor point is for the shape.

Tips & Warnings

  • Word will not allow you to add a Script object to a Range object.

Related Searches:

References

Resources

  • Photo Credit computer image by blaine stiger from Fotolia.com

Comments

You May Also Like

Related Ads

Featured