About the Microsoft Script Editor Window

The Microsoft Script Editor window supports viewing HTML for all Office applications that support saving documents in HTML. At any given time, there is only one Microsoft Script Editor window into which all open Office applications can load their HTML. In that same window, you can create new HTML files or open existing ones from any available location.

You can use the Project Explorer window in the Microsoft Script Editor to navigate among all open HTML pages, whether they were loaded from Office documents open in Office applications, or were files opened directly from a disk or network server. You can activate a particular HTML file by double-clicking it in the Project Explorer window, by selecting it from the list of windows on the Window menu, or by clicking the tab for the HTML file on the series of tabs at the top of the document window.

A Design button and an HTML button are located at the bottom of the document window, which indicate the view that the active HTML file is in (Design or HTML). Note that Microsoft Office documents cannot be displayed in Design view in the Microsoft Script Editor. If the active HTML file represents an open Office document, the Design button is disabled and displays an alert when clicked. You must activate the Office application to modify the document in Design view. If the active HTML file was newly created or was opened from a disk or network server, the Design button is enabled and you can edit the HTML file in Design view.

To view your HTML file as it will be displayed in the browser, click the View in Browser command on the File menu. The Microsoft Script Editor launches a new browser window and loads the active HTML file into it.


Microsoft Script Editor Help

Welcome to the Microsoft Script Editor. The Microsoft Script Editor allows you to view and edit HTML tags within the HTML files that are created when you save a Microsoft Office document as HTML. You can also add script, such as Microsoft Visual Basic Scripting Edition (VBScript) or JScript, to your files and debug that script.

When you are finished modifying HTML tags and script in the Microsoft Script Editor and you return to the Office application where the document is open, you can synchronize the Office document to reflect the changes you made to the HTML. When you save the Office document as HTML, those changes are saved as well.

With the Microsoft Script Editor open, you can create new HTML files and save them directly to any available location, and you can open existing HTML files from any available location to edit or debug.


About the Refresh Toolbar

Some of the content in this topic may not be applicable to some languages.

When you view your Office document in the Microsoft Script Editor, you are actually viewing a separate copy of the document. If you make changes to the copy in the Microsoft Script Editor, these changes are out of sync with the copy in the Office application. Alternatively, if you make changes to the copy in the Office application while the Microsoft Script Editor is open, these changes are also out of sync. To save the changes you made to either copy of the document, click Refresh Button image on the Refresh toolbar when you return to the unchanged copy.

Note that when you have made changes to a macro in the Visual Basic Editor while a workbook, presentation, or document is open and have also changed the copy of that Office document in the Microsoft Script Editor, an alert is displayed when you click the Refresh button, indicating that your changes to the Visual Basic project will be lost. To save your changes to the Visual Basic project, you must export the changed modules or forms from the Visual Basic Editor, refresh the Office document, and then import the saved modules or forms back into the Visual Basic project.


About the Debug Tools

The Microsoft Script Editor provides a full set of debugging tools for testing and troubleshooting HTML pages and scripts. These tools are not installed in a typical Office installation. If the debug tools are not installed, you will find the Install Web Debugging command on the Debug menu. Click this command to install the debug tools. You may be prompted to restart the Microsoft Script Editor to make the debug tools available.

For details about using the debug tools in the Microsoft Script Editor, see Inspecting Your Program.


General, Environment, Options Dialog Box

Use this page of the Options dialog box to change default settings for the Script Editor's development environment. You can access the Options dialog box by selecting Options from the Tools menu and then selecting the General page in the Environment folder.

Settings

Tabbed Documents

Select this option to display document windows that are tabbed together within the editor. Tabbed document windows are useful for organizing and switching between multiple open documents.

MDI Environment

Choose this option to open documents in a multiple document interface (MDI) environment. MDI document windows are useful for gaining the screen space that is otherwise taken up by the tabs in the tabbed documents environment. When working in MDI mode, you can switch between documents by pressing Ctrl + Tab or you can use the tile options located on the Window menu.

Note For both of these settings, you must restart the editor for changes to take effect.

Show status bar

Displays the status bar. The status bar is located at the bottom of the editor and displays information about the progress of ongoing operations.

Animate environment tools

This control allows you to enable transition effects. Clearing this option causes auto-hidden windows to appear instantly when requested rather than make a slow transition onto the screen.

Speed

Controls the speed at which animation effects such as Auto Hide are executed. Experiment with animation speeds to find the setting that best suits you. This option is available only when you select Animate environment tools.

Enable Command Window autocompletion

Select this to see command completion options as you type commands or file paths in HTML View. The Find box on the Standard toolbar also supports auto completion. When using auto completion, you do not need to type an entire command or path in most cases. As soon as you type the first character, a list appears containing matching commands that could complete the command you are typing. As you continue typing, the list narrows to reflect only the saved command or path containing the letters you have typed. When you see the desired command or path in the list, you can use either the mouse or arrow keys to select it.

Window menu contains

Customizes the number of windows that appear in the Windows list of the Windows menu. Type a number between 1 and 24. The default is 10.

Find and Replace

Show message boxes

Choose this option to display the message boxes resulting from a find and replace operation. Two examples of message boxes affected by this option are: "The specified text was not found" and " No more occurrences found in the specified documents." Clear this option to hide all message boxes.

Initialize Find text from editor

Select this option to automatically copy selected text in the editor to the Find what textbox in the Find and the Replace dialog boxes. Clearing this option reuses the last search pattern from the previous search in the Find what textbox.


About the HTML Source for Office Documents

Microsoft Office supports Hypertext Markup Language (HTML) as a native file format. Using HTML, Office documents and data can be stored, distributed, and presented in a format that can be viewed using most Web browsers, while retaining the rich content and functionality of Office documents stored using the traditional companion binary file formats. Widely used in Web pages, HTML elements are focused primarily on the presentation of content, or in other words, on how information is displayed. Although HTML is quite capable of displaying a wide variety of content, it is incapable of describing data in an efficient way.

To compensate for limitations in HTML for defining all the elements of an Office document, the Office applications use combinations of Extensible Markup Language (XML), Vector Markup Language (VML), and cascading style sheets (CSS) in addition to HTML. This allows the Office applications to preserve all the Office-specific content and information about a document when it is saved as HTML. An Office application can interpret all the content and information it saved the next time it opens the HTML file.

Show Extensible Markup Language (XML)

In order to support the wide variety of functions and features in Office, Extensible Markup Language (XML) is used. The XML standard enables the creation of an extended set of elements to define and describe data, objects, and properties, separating the data from the presentation and surmounting HTML's inability to describe these objects. XML is a subset of Standardized General Markup Language (SGML), and although SGML could be used, XML provides the necessary functionality with much less complexity. Its structured data descriptions are what makes it possible to open HTML documents in a Web browser or Office application yet retain the properties, options, and settings that are used only when editing and saving the document. The XML standard requires that the rules (or schema) for using these extended elements be specified, enabling the documents to be parsed by Web browsers, document viewers, and editors that support XML and that can act on those rules.

Show Vector Markup Language (VML)

For graphics and shapes, a subset of XML called Vector Markup Language (VML) is used to define and describe the vectors that comprise those objects within a document. In Web browsers that support VML, the definitions are used to render the graphics and shapes from vectors. Using VML instead of bitmap graphics files results in smaller file sizes and shorter document download times. In addition, VML objects can be manipulated in script to perform dynamic image transformations that are not possible when using traditional bitmap graphics.

Show Cascading style sheets (CSS)

Although HTML contains a number of text formatting elements, cascading style sheets (CSS) are required to display the full range of common Office text formats. CSS specifies text formatting and styles that the standard HTML text formatting elements, such as for bold or emphasis, cannot describe. Also, CSS works similarly to styles in Microsoft Word in that a style definition can be defined once and used many times in an HTML document. CSS provides greater control over positioning of elements such as paragraphs and images within a document.


Microsoft Access Data Access Pages

A data access page is an HTML page with a default set of elements and controls for displaying data through an HTML browser such as Internet Explorer. Data access pages can also be viewed directly in the Microsoft Access environment. Many of the controls associated with a data access page are supported by the Microsoft Office Web Components, such as the data source control and the record navigation control. These controls support connecting to data and navigating through records. It is also common to find other HTML controls placed on data access pages to support custom functions or Web navigation.

To maintain the basic functionality of a data access page, it is important not to modify the default elements of the page directly in the Microsoft Script Editor. Instead, you can use the Microsoft Script Editor to create or modify scripts associated with events that the elements on the data access page support, or to customize HTML elements or other controls you have added to a page.


Microsoft Excel Workbooks

A Microsoft Excel workbook that contains data in more than one worksheet, or that contains blank worksheets before the worksheet containing data, is stored as a frameset of two frames: a worksheet frame and a worksheet navigation tab frame. The frameset HTML file contains information about the workbook, links to supporting documents, and the frameset definition. In addition, the workbook HTML file contains default VBScript elements to support the tab functionality of the navigation tab frame. The worksheet frame contains the active worksheet HTML file. Each worksheet is stored in an HTML file. The tab frame is also stored in an HTML file and contains the tabs that allow the user to display each worksheet. A workbook is saved in a single HTML file if the first worksheet contains data and all other worksheets are blank. Additional supporting files, such as graphics files, or a cascading style sheet (CSS) for storing information about cell formatting, might be created when the workbook is saved as a Web page.

Excel worksheet data is represented in HTML tables. These tables can be modified directly to make changes to the worksheet in Excel. While changing these tables and adding scripts to the worksheet HTML files is possible, in general you should avoid modifying the workbook HTML files, supporting HTML files, or any script created by Excel. If you modify these elements, the HTML files will not work correctly, or in some cases the changes will be discarded by Excel before saving the workbook as HTML.


Microsoft PowerPoint Presentations

When Microsoft PowerPoint saves presentations to Web pages, it creates various subfiles that comprise the functionality of the slides in a presentation. Each slide will have an HTML page that contains the data. There will also be a master slide in HTML for the slide master. Extra information about the files is stored in XML format. Other supporting files that are saved are sound files, graphics files, cascading style sheets, and proprietary files used to store OLE data that is required to reload the HTML into PowerPoint. A subset of these files are available to view in the Microsoft Script Editor when you open a presentation in it.

When PowerPoint saves a presentation as Web pages, it creates script to control the behavior of slide transitions and other animations. When viewing the source HTML for a presentation in the Microsoft Script Editor, it's important to avoid changing or removing any of the script that PowerPoint creates.


Microsoft Word Documents

Microsoft Word documents are saved as single HTML files. Word- and Office-specific data is stored in Extensible Markup Language (XML) embedded in the HEAD element of the HTML file. Formatting and attributes of the contents of paragraphs and tables are preserved by style classes. Elements that cannot be covered by standard HTML CSS style attributes are covered by Microsoft Office-specific attributes. When Word saves a document to HTML, it preserves named styles by creating style definitions in the STYLE element and applying those styles with the class attribute whenever possible.


About Events

Script code is contained within an HTML SCRIPT element, and there can be one or more SCRIPT elements in an HTML file. The code is organized in functions and subroutines within the element. These procedures can be executed by an explicit call or triggered when a specific event occurs, such as when a button is clicked.

By default, Excel workbooks, PowerPoint presentations, and Word documents saved as Web pages support the events associated with the WINDOW element. FrontPage Web pages also support the WINDOW element and its events. Access data access pages contain more client objects by default, and their corresponding events are all available for scripting. As you add elements to a Web page, those elements and their corresponding events become available to script in the Microsoft Script Editor.

When you load a Web page in the Microsoft Script Editor, you can use the Document Outline window or the Object and Event boxes in HTML view to create or modify scripts for events supported by the elements in the active HTML file.


Change the default script language

  1. In the document window, click the HTML tab.
  2. In the Properties window, change the value of the defaultClientScript property to the script language you want, either VBScript or JavaScript.


Creating and Editing Scripts on HTML Pages

You can create client-side scripts for your HTML page in HTML View of the Microsoft Script Editor. Build a function by selecting an object, assigning an event to the object, and completing the appropriate script arguments.

To change the defaultClientScript property while editing a Web page

  1. Select the page in the Script Editor.
  2. From the drop-down menu at the top of the Properties window, select Document.
  3. Select a value for the defaultClientScript property.

  4. If you adjust the defaultClientScript property to a value different than the default, a META NAME=VS_DEFAULTCLIENTSCRIPT tag is inserted into the <HEAD></HEAD> section of your page. For instance, if you select VBScript, the following tag is added:

    <META NAME=VS_DEFAULTCLIENTSCRIPT CONTENT="VBScript">.

    Note You can also specify the scripting language for a particular SCRIPT by including a type (HTML 4.0 and above) or language (HTML 3.2) attribute in the <SCRIPT></SCRIPT> tag.

    <SCRIPT TYPE="text/javascript" LANGUAGE="javascript">

To create a new handler function for an event

  1. Open your Web page in HTML View.
  2. Select an object on your page in the Object drop-down list box (see below).

Object drop down art

  1. Select an event from the Event drop-down list box.

    A new blank handler function is added to a "clientEventHandlers" or "serverEventHandlers" <SCRIPT> block in the <HEAD> of your page.

  2. Complete this new function by writing arguments.


Changing and Selecting Text

Whether you are editing code, HTML, or plain text, the Microsoft Script Editor works the same and functions like other text editors or word processors.

To add or insert text

  1. Either click somewhere in the document or move the cursor to the desired location.
  2. Type the text. If your cursor is between existing characters, the text is inserted between them.

To overwrite characters in an existing line, press the INSERT key to put the editor in Overstrike mode. You can tell that it is in that mode when the cursor turns from a flashing line into a flashing block, and by the OVR displayed in the bottom right corner on the Script Editor taskbar. Press the INSERT key again to return to Insertion (INS) mode.

To delete characters or a word in a line

  1. Place the cursor immediately before or immediately after the word or letter you want to delete.
  2. Press the DELETE or BACKSPACE key, as appropriate, as many times as needed to delete the characters or words. In Design view, press CTRL+DELETE and CTRL+BACKSPACE to delete whole words.

Alternatively, you can double-click a word and then press DELETE or BACKSPACE to delete it.

To delete lines, paragraphs, and pages

  1. Highlight the text you want to delete by holding down the left mouse button and dragging over the text, or by using the SHIFT key with the HOME, END, PAGEUP, or PAGEDOWN key, or with one of the arrow keys. You can click in the Selection Margin to select the current line.
  2. Press DELETE or BACKSPACE.

You can also cut, copy, and drag and drop text in your document. For more information, see Dragging and Dropping Text.

You can format your code or let the environment do it for you. For more information, see Managing Code Formatting.

Selecting Text

The Script Editor has two text selection modes:

  • Stream Mode The selection acts similarly to the standard Microsoft Windows multi-line edit control. Selection is a one-dimensional stream from the start of the file to the end. Entire lines are selected when you move to the next or a previous line. To select an entire line, click the Selection Margin (on the far left of the Script Editor window).
  • Column (Box) Mode Rectangular boxes of code are selected. When you press ALT, left-click the mouse and drag it over text, only the rectangular portion of text you highlight is selected instead of the whole line. The selection includes any character that intersects with the rectangle defined by the beginning character (anchor character) and the last character in the selection. If the selection width is zero, then whole lines are selected.

To stream select text

  • Left-click and drag the mouse over the text.
  • Alternatively, use the SHIFT+Arrow keys.

To column select text

  • Hold down the ALT key, and then left-click the mouse and drag it over the text.
  • Alternatively, use the SHIFT+ALT+Arrow keys.

For information about moving around in a document, see Navigating Text.


Setting the targetSchema Property

The targetSchema property selects the minimum version of HTML a Web browser must support to display your Web page properly. The default schema is HTML 3.2.

Note To use CSS styles, you must select a targetSchema value of HTML 4.0, Navigator 4.0, or higher.

To set the default value for the targetSchema property

  1. Click Property Pages on the View menu.
  2. On the General tab, select a value for the targetSchema property.

To adjust the value of the targetSchema property while editing an HTML page

  1. Click on the page in HTML View.
  2. From the drop-down menu at the top of the Properties window, select Document.
  3. Select a value for the targetSchema property.

    If you adjust the targetSchema property to a value different than the default, a META NAME=VS_TARGETSCHEMA tag is inserted into the <HEAD></HEAD> section of your page. For instance, if you select the value HTML 4.0, the following META tag is inserted:

    <META NAME=VS_TARGETSCHEMA CONTENT="HTML 4.0">.

    Note When a browser name is included in a targetSchema value, this indicates a particular Document Object Model (DOM) to be targeted by your HTML markup.


Accessibility Options

The Microsoft Script Editor contains features that make it easier for people who have low vision to read and for people who have limited dexterity to write.

To change the size of text

  1. On the Tools menu, click Options.
  2. In the Environment folder, click Fonts and Colors.
  3. Select an option from the Show settings for drop-down menu.
  4. Select a font in the Font drop-down menu.
  5. From the Size drop-down menu, select a new value.
  6. Click OK.

To change the color of items in the editor

  1. On the Tools menu, click Options.
  2. In the Environment folder, click Fonts and Colors.
  3. From the Display items box, select an item whose display you need to change.
  4. Select display settings in the following boxes: Item foreground, Item background and Bold.
  5. Click OK.

To automate the entry of text and graphics

  1. On the Tools menu, click Options.
  2. In the Environment folder, click General.
  3. Click Enable Command Window autocompletion.
  4. Click OK.

To improve toolbar usability and accessibility, you can enlarge or add text to toolbar buttons.

To display large icons on toolbars

  1. On the View menu, point to Toolbars, and then click Customize.
  2. In the Customize dialog box, click the Options tab.
  3. Under Other, click Large icons.

To assign text to toolbar buttons

  1. On the View menu, point to Toolbars, and then click Customize.
  2. In the Customize dialog box, click the Toolbars tab.
  3. Select and enable the toolbar containing the button image you want to change.
  4. Leaving the Customize dialog box open, click on the button you want to change.

    A black square or rectangle indicates that the button is selected for modification.

  5. Click the Commands tab.
  6. Click Modify Selection.
  7. Click Image and Text.

To modify the button's displayed text

  1. Reclick Modify Selection.
  2. Adjacent to Name, type a new caption for the selected button.


Managing Code Formatting

The Microsoft Script Editor gives you the ability to format your code with options such as indenting, hiding text, displaying URLs, and so forth. It also provides features to auto-format your code as you type through Smart Indenting.

Indenting

You can choose three different styles of text indenting. You can also specify how many spaces compose a single indent or tab, and whether the Script Editor uses tabs or space characters when indenting.

To choose an indentation style

  1. On the Tools menu, click Options, and then click Text Editor.
  2. Click the HTML folder, or click All Languages to affect indentation settings for all languages.
  3. Click Tabs, click one of the options under Indenting, and then click OK:
    • None The cursor goes to the beginning of the next line.
    • Block The cursor aligns the next line with the previous line.
    • Smart (Default) The language service determines the appropriate indentation style to use. For example, if you are creating a For…Next loop in VBScript, the lines are indented accordingly.

To change indent tab settings

  1. On the Tools menu, click Options, and then click Text Editor.
  2. Click the HTML folder, or click All Languages to affect indentation settings for all languages, and then click Tabs.
  3. To specify that tab characters are used in tab and indentation operations, click Keep tabs. To specify that space characters are used, click Insert spaces.
  4. If you select Insert spaces, you can enter the number of space characters each tab or indent represents in the Tab size or Indent size box, respectively.

To indent code

  1. Select the text you want to indent.
  2. Press the TAB key, or click Increase Indent.

To unindent code

  1. Select the text you want to unindent.
  2. Press SHIFT+TAB, or click Decrease Indent.

To automatically indent all of your code

  1. Click Options on the Tools menu, and then click Text Editor.
  2. Click All Languages and then click Tabs.
  3. Under Indenting click Smart.

Hiding Text

By default, all text is displayed in the Script Editor, but in some circumstances you can hide the code from view. For details about this, see Outlining and Hiding Code. There are two different types of hidden text:

  • Concealed (HTML View only)–Hidden text that is concealed gives no indication that it is missing from view. The only way to tell is to turn on line numbering. HTML View uses concealed text to provide a script-only view where all text that is not part of the script code is hidden from view. If you select across concealed text and delete it, the non-visible text is not deleted.
  • Collapsed You can choose to hide selected text from view by creating an outlining section. To do this, select the text, and then click Hide Selection on the Outlining submenu of the Edit menu. The text then collapses under the top-most selected line, and a plus sign (+) is displayed in the indicator margin to the left of the line. To expand the lines for viewing, click the plus sign. The same procedure applies to outlining. If you select across collapsed text and delete it, all selected text is deleted, including the collapsed text.

    Note A regular find operation searches for text in hidden regions based on the setting of an option in the Find dialog box, but an incremental search does not search for text in hidden regions.

Converting Text to Upper and Lowercase

You can use commands to convert text to all upper or lowercase.

To switch text to upper or lowercase

  1. Select the text you want to convert.
  2. To convert text to uppercase, press CTRL+SHIFT+U, or click Make Uppercase on the Advanced submenu of the Edit menu.
  3. To convert text to lowercase, press CTRL+U, or click Make Lowercase on the Advanced submenu of the Edit menu.

The case conversion commands do not affect the case of intrinsic commands.

Displaying and Linking to URLs

You can create and display active URLs (Uniform Resource Locators) in your code. You can then click the link and be taken to the Web page in a browser. By default, the URLs:

  • Appear underlined.
  • Change the mouse pointer to a hand when you move it over them.
  • Open the URL site when single-clicked, if the URL is valid.


Customizing Toolbars

You can change the layout, position, and content of toolbars in the Microsoft Script Editor. You can also add buttons to toolbars and change the assigned icon for any button.

To add a new toolbar

  1. On the View menu, point to Toolbars, and then click Customize.
  2. In the Customize dialog box, click the Toolbars tab.
  3. Click New, and in the New Toolbar dialog box, type a name.
  4. Click OK.

To add a command button to a toolbar

  1. On the View menu, point to Toolbars, and then click Customize.
  2. In the Customize dialog box, click the Toolbars tab.
  3. Select and enable the toolbar you want to customize.
  4. Click the Commands tab.
  5. Go to the category that contains the command you want to add to the toolbar in Categories.
  6. Select an item in Commands.
  7. Drag the Commands item from the Customize dialog box to a toolbar of your choice.
  8. When the mouse pointer displays a plus (+) symbol, drop your item onto the toolbar.

The Script Editor provides button images that can be exchanged with the default toolbar icons.

To change toolbar button images

  1. On the View menu, point to Toolbars, and then click Customize.
  2. In the Customize dialog box, click the Toolbars tab.
  3. Select and enable the toolbar containing the button image you want to change.
  4. Leaving the Customize dialog box open, click the button you want to change.

    A black square or rectangle indicates that the button is selected for modification.

  5. Click the Commands tab.
  6. Click Modify Selection, click Change Button Image, and then select an alternative from the cascading menu.

    Tip

    If you are unsatisfied with the alternative images provided, you can customize a selected system image.

To edit button images

  1. On the View menu, point to Toolbars, and then click Customize.
  2. In the Customize dialog box, click the Toolbars tab.
  3. Select and enable the toolbar containing the button image you want to change.
  4. Leaving the Customize dialog box open, click the button you want to change.

    A black square or rectangle indicates that the button is selected for modification.

  5. Click the Commands tab, and then click Modify Selection.
  6. Click Edit Button Image, and use the Button Editor dialog box to customize the selected button's image.

    Note The Customize dialog box can be used to customize menus as well.


Microsoft Script Editor Default Shortcut Keys

The table below lists the key combinations available for the Microsoft Script Editor default keyboard scheme.

Shortcut Keys | Description
SHIFT + F10 | Displays the shortcut menu for the given window.
F1 | Displays Help.
ALT + F4 | Closes the Microsoft Script Editor.
CTRL + ALT + V, A | Displays the Auto window to view the values of variables currently in the scope of the current line of execution within the current procedure.
CTRL + ALT+ Break | Temporarily stops execution of all processes in a debugging session. Available only in run mode.
CTRL + ALT + B | Displays the Breakpoints dialog box, where you can add and modify breakpoints.
CTRL + ALT + C | Displays the Call Stack window to display a list of all active procedures. Available only in run mode.
CTRL + SHIFT + F9 | Clears all of the breakpoints in the project.
CTRL + ALT + I | Displays the Immediate window, where you can evaluate expressions and execute individual commands.
CTRL + ALT + V, L | Displays the Locals window to view the variables and their values for each procedure in the current stack frame.
ALT + F9, N | Displays the New Breakpoint dialog box.
CTRL + ALT + P | Displays the Processes dialog box, which allows you to view and manipulate programs in a solution.
CTRL + ALT + Q | Displays the Quick Watch dialog box with the current value of the selected expression. Available only in break mode. Use this command to check the current value of a variable, property, or other expression for which you have not defined a watch expression.
CTRL + SHIFT + F5 | Terminates a debugging session, rebuilds, and then starts running the application from the beginning again. Available in break and run modes.
CTRL + ALT + N | Displays the Running Documents window, which displays the set of documents that are in the process you are debugging. Available in run mode.
CTRL + F10 | In break mode, resumes execution of your code from the current statement to the selected statement. The Current Line of Execution margin indicator appears in the Margin Indicator bar.
CTRL + SHIFT + F10 | Sets the execution point to the line of code you choose.
ALT + NUM * | Highlights the next statement to be executed.
F5 | Automatically attaches the debugger and runs the application from the startup form specified in the <Project> Properties dialog box. Changes to Continue if in break mode.
CTRL + F5 | Runs the code without invoking the debugger.
F11 | Executes code one statement at a time, following execution into function calls.
SHIFT + F11 | Executes the remaining lines of a function in which the current execution point lies.
F10 | Executes the next line of code but does not follow execution through any function calls.
SHIFT + F5 | Stops running the current application in the program. Available in break and run modes.
F9 | Sets or removes a breakpoint at the current line.
CTRL + ALT + W | Displays the Watch window to view the values of selected variables or watch expressions.
ENTER | Inserts a blank line at the insertion point.
Left Arrow | Moves the cursor left one character.
SHIFT + Left Arrow | Moves the cursor left one character, extending the selection.
SHIFT + ALT + Left Arrow | Moves the cursor left one character, extending the column selection.
Right Arrow | Moves the cursor one character to the right.
SHIFT + Right Arrow | Moves the cursor right one character, extending the selection.
SHIFT + ALT + Right Arrow | Moves the cursor right one character, extending the column selection.
CTRL + T | Swaps the characters on either side of the insertion point. For example, AC|BD becomes AB|CD.
CTRL + K, CTRL + L | Removes all unnamed bookmarks in the current document.
ALT + Right Arrow | Displays Word Completion based on the current language.
CTRL + C | Copies the currently selected item to the system Clipboard.
CTRL + X | Removes the currently selected item to the system Clipboard.
CTRL + SHIFT + INS CTRL + SHIFT + V | Pastes an item from the Clipboard Ring tab of the Toolbox at the insertion point in the file and automatically selects the pasted item.
DELETE | Deletes one character to the right of the cursor.
BACKSPACE | Deletes one character to the left of the cursor.
CTRL + K, CTRL + \ | Collapses white space in the selection, or deletes white space adjacent to the cursor if no selection.
CTRL + END | Moves the insertion point to the last line of the document.
CTRL + SHIFT + END | Selects the text from the insertion point to the last line of the document.
CTRL + HOME | Moves the insertion point to the first line of the document.
CTRL + SHIFT + HOME | Selects the text from the insertion point to the first line of the document.
CTRL + F | Displays the Find dialog box.
F3 | Finds the next occurrence of the previous search text.
CTRL + F3 | Finds the next occurrence of the currently selected text in the document.
SHIFT + F3 | Finds the previous occurrence of the search text.
CTRL + SHIFT + F3 | Finds the previous occurrence of the currently selected text, or the word at the caret.
CTRL + G | Displays the Go To Line dialog box.
CTRL + ] | Moves the insertion point to the next brace in the document.
CTRL + SHIFT + ] | Moves the insertion point to the next brace, extending the selection.
CTRL + D CTRL + / | Places the caret in the Find box on the Standard toolbar.
ALT + F3, H | Selects or clears the Search hidden text option for the Find dialog box.
CTRL + M, CTRL + H | Hides the selected text. A signal icon marks the location of the hidden text in the file.
CTRL + I | Starts incremental search. If incremental search is started, but you have not typed any characters, recalls the previous pattern. If text has been found, searches for the next occurrence.
TAB | Indents the line of text a specified number of spaces, such as five.
CTRL + L | Cuts all selected lines, or the current line if no selection, to the Clipboard.
CTRL + SHIFT + L | Deletes all selected lines, or the current line if no selection.
Down Arrow | Moves the cursor down one line.
SHIFT + Down Arrow | Extends text selection down one line, starting at the location of the insertion point.
SHIFT + ALT + Down Arrow | Moves the cursor down one line, extending the column selection.
END | Moves the cursor to the end of the current line.
SHIFT + END | Selects text from the insertion point to the end of the current line.
SHIFT + ALT + END | Moves the insertion point to the end of the line, extending the column selection.
CTRL + ENTER | Inserts a blank line above the insertion point.
CTRL + SHIFT + ENTER | Inserts a blank line below the insertion point.
HOME | Moves the cursor to the beginning of the line.
SHIFT + HOME | Selects text from the insertion point to the start of the line.
SHIFT + ALT + HOME | Moves the insertion point to the start of the line, extending the column selection.
SHIFT + ALT + T | Moves the line containing the insertion point below the next line.
Up Arrow | Moves the cursor up one line.
SHIFT + Up Arrow | Selects text up line by line starting from the location of the insertion point.
SHIFT + ALT + Up Arrow | Moves the cursor up one line, extending the column selection.
CTRL + J | Lists members of the current class for statement completion when editing code. Only available in HTML View of the HTML Editor.
CTRL + U | Changes the selected text to lowercase characters.
CTRL + SHIFT + U | Changes the selected text to uppercase characters.
ALT + F3, B | Selects or clears the Search up option for find and replace operations.
ALT + F3, C | Selects or clears the Match case option for find and replace operations.
CTRL + K, CTRL + N | Moves to the next bookmark in the document.
INSERT | Puts the keyboard in overtype mode.
PAGE DOWN | Scrolls down one screen in the editor window.
SHIFT + Page Down | Extends selection down one page.
PAGE UP | Scrolls up one screen in the editor window.
SHIFT + Page Up | Extends selection up one page.
CTRL + V | Inserts the Clipboard contents at the insertion point.
CTRL + K, CTRL + P | Moves to the previous bookmark.
CTRL + SHIFT + Z | Restores the previously undone action.
ALT + F3, R | Selects or clears the Regular expression option so that special characters can be used in find and replace operations.
CTRL + H | Displays the Replace dialog box.
CTRL + SHIFT + I | Changes the direction of incremental search to begin at the bottom of the file and progress towards the top.
CTRL + Down Arrow | Scrolls text down one line.
CTRL + Up Arrow | Scrolls text up one line.
CTRL + A | Selects everything in the current document.
CTRL + M, CTRL + U | Displays previously hidden text.
CTRL + M, CTRL + P | Diplays all previously hidden text in the file.
SHIFT + TAB | Moves selected lines left one tab stop.
CTRL + M, CTRL + L | Toggles all previously marked hidden text sections between hidden and display states.
CTRL + K, CTRL + K | Sets or removes a bookmark at the current line.
CTRL + M, CTRL + M | Toggles the currently selected hidden text section between the hidden and display state.
CTRL +R, CTRL + R | Enables or disables word wrap in the editor.
ALT + BACKSPACE CTRL + Z | Reverses the last editing action.
CTRL + SHIFT + Page Down | Moves the cursor to the last line in view, extending the selection.
CTRL + SHIFT + Page Up | Extends the selection to the top of the current window.
ALT + F3, W | Selects or clears the Match whole word option for find and replace operations.
ALT + F3, P | Selects or clears the Wildcard option for find and replace operations.
CTRL + DEL | In Design View, deletes the word to the right of the insertion point.
CTRL + BACKSPACE | In Design View, deletes the word to the left of the insertion point.
CTRL + Right Arrow | In Design View, moves the insertion point right one word.
CTRL + SHIFT + Right Arrow | In Design View, extends the selection one word to the right.
CTRL + Left Arrow | In Design View, moves the insertion point left one word.
CTRL + SHIFT + Left Arrow | In Design View, extends the selection one word to the left.
CTRL + N | Displays the New File dialog box, where you can select a new file to add to the current project.
CTRL + O | Displays the Open File dialog box, where you can select to open an existing file.
CTRL + P | Displays the Print dialog box, where you can choose printer settings.
CTRL + SHIFT + S | Saves all open documents.
CTRL + S | Saves the currently selected document.
CTRL + B | Toggles the selected text between bold and normal.
CTRL + I | Toggles the selected text between italic and normal.
CTRL + SHIFT + K | Prevents an absolutely positioned element from being inadvertently moved.
CTRL + U | Toggles the selected text between underlined and normal.
CTRL + ALT + T | Displays the Document Outline window to view the flat or hierarchical outline of the current document.
SHIFT + ALT + ENTER | Toggles Full Screen mode on and off.
CTRL + - | Goes back to the previous document or window in the navigation history.
CTRL + SHIFT + - | Moves forward to the document or window next in the navigation history.
CTRL + ALT + J | Displays the Object Browser to view the classes, properties, methods, events, and constants available for packages and object libraries and the procedures in your project.
F4 | Displays the Properties window, which lists the design-time properties and events for the currently selected item.
SHIFT + F4 | Displays the property pages for the item currently selected.
CTRL + ALT + X | Displays the Toolbox, which contains controls and other items that can be included or used with your code.
ESC | Closes a menu or dialog box, cancels an operation in progress, or places focus in the current document window.
CTRL + F4 | Closes the current MDI child window.
SHIFT + ESC | Closes the current tool window.
CTRL + F2 | Moves the cursor to the Object drop-down list box in HTML View.
CTRL + TAB | Cycles through the MDI child windows one window at a time.
ALT + F6 | Moves to the next tool window.
F6 | Moves to the next pane of a split pane view of a single document.
CTRL + Page Down | Moves to the next tab in the document or window.
CTRL + SHIFT + TAB | Moves to the previous document in the editor or designer.
SHIFT + ALT + F6 | Moves to the previously selected window.
SHIFT + F6 | Moves to the previous pane of a document in split pane view.
CTRL + Page UP | Moves to the previous tab in the document or window.


Managing the Script Editor and View

The Microsoft Script Editor provides several ways to control the view of your script. The information below describes how to work with these views.

Changing the view mode

The Script Editor features an additional new view mode called Tabbed Documents that allows you to have multiple editors and documents open simultaneously and to access them through tabs at the top of the editor. Alternatively, you can open the development environment in MDI (Multiple Document Interface) mode, where the windows are all joined together (but without the tabs) and each window can be tiled, minimized, and so forth.

To switch between view modes

  1. Navigate to the General page of the Environment folder in the Options dialog box (Tools menu).
  2. Under Settings, choose one of the following view modes:
    • Tabbed Documents
    • MDI environment

Splitting the View

The Script Editor can be split into two separate parts for easier editing.

To split a pane

  1. Click the splitter bar (located above the scroll bar).
  2. Drag the splitter bar downward.
  3. To go back to a single pane, double-click the splitter bar dividing the two panes.

The new pane contains the same document, and any changes made to it are reflected in the other pane as long as that pane displays the same place in the document.

Word wrap

When you activate word wrap by pressing CTRL+R twice, the horizontal scrollbar is removed and lines of code that exceed the width of the editor's window size automatically wrap to the next displayed line rather than scrolling off the side of the window.

To activate word wrap

  1. On the Tools menu, click Options, and then click Text Editor.
  2. Click the HTML folder (or the All Languages folder to affect all languages).
  3. Click Word wrap. Alternatively, pressing CTRL+R and then CTRL+R again toggles this option.

Enabling Virtual Space mode

In Virtual Space mode, the editor acts as if the space past the end of each line is filled with an infinite number of spaces, allowing code lines to continue beyond the side of the visible screen area.

To enable Virtual Space mode

  1. On the Tools menu, click Options, and then click Text Editor.
  2. Click the HTML page (or the All Languages page to affect all languages).
  3. Click Enable Virtual Space.

When Virtual Space mode is not enabled, the cursor wraps from the end of one line to the first character of the next line and vice versa.

Note Virtual Space mode is active whenever you are in Column Selection mode.

Displaying Line Numbers

You can turn on line numbering in your code. Line numbers are useful, for example, in Navigating Text.

Note Turning on line numbering does not mean that the document will print with line numbers. For line numbers to print, you must click Line numbers in the Page Setup dialog box (File menu).

To display line numbers in code

  1. Click Options on the Tools menu, and from the Text Editor tab, navigate to the General page of the All Languages folder.
  2. Under Display, click Line numbers.

Enabling Full Screen mode

You can choose to hide all tool windows and view only document windows by enabling Full Screen mode.

To enable Full Screen mode

  • Press ALT+SHIFT+ENTER to enter or exit Full Screen mode.

Additional view options

There are other ways to affect the view of your code or text:

  • Fonts and size

    On the Fonts And Colors page of the Environment folder in the Options dialog box (Tools menu), you can change the fonts and colors that display in the editor, as well as how text appears when printed.


Arranging Windows

The Microsoft Script Editor environment has two types of windows— tool windows and document windows. You can increase the viewing and editing space for code, depending on how you arrange the windows. You have several options for arranging windows, including the following:

  • Tab-link several windows.
  • Dock tool windows to an edge of the development environment.
  • Minimize tool windows along any edge of the development environment.
  • Tile document windows.

For more information on the differences between tool and document windows, see Window Types.

To tab-dock windows

  1. For a tool window, click Dockable on the Window menu and then, using the pointer, drag the window over the title bar of the destination tool window.
  2. When you see a superimposed outline of the window with a tab, release the mouse button to place the window.

    Note The position of the mouse pointer determines where the window will be placed, not the edges of the window.

    Tip To move a dockable window without snapping it into place, press CTRL while dragging it to the location you desire.

To dock or hide tool windows

  • Click Dockable on the Window menu, and then drag the window toward an edge of the development environment window until you see a superimposed outline in the location you want.

    Note The position of the mouse pointer, not the edges of the window, determines where the window will be placed.

  • Right-click the window and click Auto Hide. The window will reappear when your cursor is near the edge of the development environment window.

If you want to view more than one document at a time while editing code, you can tile documents together.

To tile document windows

  • In Tabbed Documents mode, select a tab and drag it below or above the current document tile. A rectangular outline appears in the location that the new document tile will be placed, based on the position of the cursor.

    or

  • In MDI mode, click Tile Windows on the Window menu.


Outlining and Hiding Code

The Microsoft Script Editor offers you the option of creating a hierarchical, outlined overview that gives you a big-picture view of the overall structure of your document.

Outlining code

You can select a region of code (that is, a selected block of text) and hide (or collapse) it so that it appears under a symbol. You can then expand or hide the region by clicking the plus sign (+) next to the symbol. Outlined code is not deleted, it is merely hidden from view.

You can create nested regions of outlining so that you might expand one section that contains one or more subsections of collapsed text.

After outlining code, you can expand only the sections you want to work on, collapse them when you’re done, and then move to another section. When you are through outlining, you can use the Stop Outlining command to remove the outline information without disturbing your underlying code.

Caution Outlining information in a region is lost if you make changes to that region, such as by deleting horizontal whitespace or by using a find and replace operation.

On the Outlining submenu (Edit menu) there are always five different commands available:

  • Hide Selection Hides the currently selected text. Text must be selected for this command to be enabled.
  • Toggle Outlining Expansion Reverses the current hidden or expanded state of the innermost outlining section in which the cursor lies when you are in a nested collapsed section.
  • Toggle All Outlining Sets all procedures to the same hidden or expanded state. If some regions are expanded and some hidden, then all regions are hidden.
  • Stop Outlining Removes all outlining information for the entire document. All procedures are visible and the symbols removed, but the underlying code is undisturbed.
  • Stop Hiding Current Removes the outlining information for the currently selected user-defined region.

To create and hide a region

  1. Select the text you want to hide.
  2. On the Outlining submenu (Edit menu), click Hide Selection.

You can repeat this process several times and then use the Toggle Outlining Expansion and Toggle All Outlining commands to hide them or make them visible.

To stop outlining a specific outlined section of text

  • On the Outlining submenu (Edit menu), click Stop Hiding Current. This removes the user-defined region but does not disturb the text.

To stop outlining in an entire document

  • On the Outlining submenu (Edit menu), click Stop Outlining. All outlining information is discarded.

Expanding and collapsing regions

To expand or collapse a previously created region

  1. Put the cursor on the hidden region.
  2. On the Outlining submenu (Edit menu), click Toggle Outlining Expansion, or press CTRL+M twice. Alternatively, you can click the plus sign (+) or minus sign (-) to the left of the region. Another way to expand a previously created region is to double-click the ellipsis symbol (...).

The Undo and Redo commands on the Edit menu affect these actions. In other words, if you create a hidden region, clicking Undo reverses that action. Also, cut, paste and drag-and-drop operations retain the hidden regions and the outline information.

Script-only view

In the Script Editor, you can activate a Script-Only view in which only script blocks are displayed.

To enable script-only view

  1. Open the HTML document.
  2. In the upper right corner of the document, click Script Only View.
  3. To return to the default view, click Full HTML View .


Managing Tabs and Items in the Toolbox

A variety of methods are available to customize the appearance of Toolbox tabs and their items. For example, you can do the following:

  • Add and remove custom tabs.
  • Add and remove items on tabs.
  • Rename tabs and items on tabs.
  • Show all tabs, or conceal those not in use.
  • Display the tools on a tab as compact icons or in labeled lists.
  • Sort all items on a tab alphabetically.
  • Reposition items on a tab.

The Toolbox displays the General and Clipboard Ring tabs by default.

To use the Clipboard Ring tab

  • To store an item on this tab, select the item and press CTRL+C, or drag the item to the Clipboard Ring tab.
  • To paste in the most recent item on the Clipboard Ring, press CTRL+SHIFT+V. Keep pressing this key combination to cycle through Clipboard Ring items until the desired entry appears.

To add a custom tab to the Toolbox

  1. Right-click on any existing tab and click Add Tab on its shortcut menu.
  2. In the text box at the bottom of the Toolbox, type a name for the new tab and then press ENTER.

    You can then select the tab and add other items. Use custom tabs to store favorite controls, text scraps, and other frequently used items.

    Note The new tab appears at the bottom of the Toolbox, with the Pointer tool automatically added.

To remove a custom tab from the Toolbox

  1. Right-click the Toolbox tab you no longer need, and then click Delete Tab.

    A message box informs you that any items on the tab will be deleted.

  2. If you still need any item on this tab, click No, and then drag the items you need to other Toolbox tabs.
  3. When you have removed all the items you need, click Delete Tab again, and then click Yes to delete the selected tab from the Toolbox.

To add or remove items on a Toolbox tab

  1. On the Tools menu, click Customize Toolbox.
  2. In the Customize Toolbox dialog box, select the items you want to add and deselect those you want to remove.

    or

    Click Browse to add items not available on the current list.

  3. Click OK to close the Customize Toolbox dialog box. New tools are added to the tab currently selected in the Toolbox. From there, you can drag them to other tabs. Items deselected in the Customize Toolbox dialog box will no longer appear on their former tabs.

    Note Some controls added to the Toolbox must be registered on your computer to be used in the Microsoft Script Editor.

To rename Toolbox tabs

  1. In the Toolbox, right-click the desired tab, and then click Rename Tab.
  2. In the text box, type a new name for the tab and press ENTER.

To rename items on Toolbox tabs

  1. In the Toolbox, right-click the desired tab item and click Rename Item.
  2. In the text box, type a new name for the item, and then press ENTER.

To show all tabs in the Toolbox, or conceal those not in use

  • In the Toolbox, right-click any tab, and then click Show All Tabs.

    Note Some items displayed might not be available for use. This option toggles on and off.

To display items on a Toolbox tab as compact icons or in labeled lists

  • In the Toolbox, right-click the desired tab, and then click List View.

    Note This option toggles on and off.

To sort the items on a Toolbox tab alphabetically

  • In the Toolbox, right-click the desired tab, and then click Sort Items Alphabetically.

    Note This option toggles on and off.

To reposition items on a tab

  • In the Toolbox, right-click the item you wish to reposition, and then click Move Up or Move Down.

    Note When you deselect List View to display Toolbox items as compact icons, clicking Move Up shifts the selected icon to the left, and clicking Move Down shifts it to the right.


Design View

Design View can be used for files that have been newly created in the Microsoft Script Editor or for files that have been opened in the editor from a disk or network server. To select Design View, click the Design tab at the bottom of the document window.

Design View provides a graphical environment within which you can design and edit Web documents. This WYSIWYG environment uses the customary drag-and-drop editing conventions to add, format, size, and position text, objects, and tables. When you select an element on a page, the Properties window displays the attributes that apply to the selected element. The Document Outline window enables you to navigate to specific objects within a document.

Note Design View displays only the body of a document— the portion between the <BODY></BODY> tags. Although you can edit some properties of the <HEAD>, such as <TITLE>, in the Properties window, you must switch to HTML View to edit most properties of the <HEAD>.

How Design View Differs from Viewing in a Web Browser

A document displayed in Design View differs from one displayed in a Web browser in these ways:

  • The user can do drag-and-drop operations on HTML elements in Design View.
  • Character and paragraph formatting can appear different (each Web browser implements some formatting differently).
  • Hyperlinks are not functional.
  • Client scripts do not run.
  • Marquee elements do not scroll.
  • Elements that support alternate text (such as images) do not display the alternate text in ToolTips when the pointer passes over them.
  • Design View displays symbols for some elements, such as HTML comments or scripts, that are not normally visible in a Web browser.

To display the current document in your Web browser, right-click on the document in Design View and select View in Browser from the shortcut menu.

When you choose to show details, the following symbols represent invisible elements on your page.

Symbol | Represents
Comment symbol | HTML comment
Script block symbol | Client-side <SCRIPT> block, or server-side script block in .asp page (<%%> or<SCRIPT RUNAT="Server">)
Style block symbol | <STYLE> block
Div tag | <DIV> tag
span tag | <SPAN> tag
paragraph symbol | <P> </P> (visible only in Linear Layout)
unknown tag | Unrecognized HTML tag
Form tag | <FORM> tag


Navigating Text

There are several ways to move throughout text:

  • Mouse and navigation keys
  • Bookmarks
  • Incremental search
  • The Go To Line command
  • The Navigate Backward and Navigate Forward buttons

Navigating with the mouse and keys

The most common way to navigate text is with the mouse and navigation keys:

  • Use the arrow keys to move one character at a time, or, in Design view, use the arrow keys in combination with the CTRL key to move one word at a time. Arrow keys move one line at a time also.
  • Click a location with the mouse.
  • Use the scroll bars or the scroll wheel on a mouse to move through the text.
  • Use the HOME, END, PAGEUP, and PAGEDOWN keys.
  • Use CTRL+UP ARROW and CTRL+DOWN ARROW to scroll the view without moving the insertion point.

You can also go directly to a procedure by clicking the Object box in the upper left corner of the document, and then clicking a procedure in the Event box in the upper right corner of the document.

Navigating with Bookmarks

To edit a document elsewhere and then return to your current location, add a bookmark.

To add a temporary bookmark

  1. Click the line you want to return to at later time.
  2. Click Toggle Bookmark Button image. You should see the temporary (or "unnamed") bookmark symbol bookmark symbol appear next to the line.
  3. Alternatively, you can press CTRL+K twice to toggle the bookmark.

To return to a temporary bookmark

  • Click Next Bookmark Button image or Previous Bookmark Button image . Alternatively, you can press CTRL+K and then CTRL+N for the next bookmark, or CTRL+K and then CTRL+P for the previous bookmark within a document.

    Tip

    Another way to return to a location is by using the Navigate Backward and Navigate Forward buttons.

To remove one or more temporary bookmarks in a document

  • Click Clear Bookmarks Button image.

    or

  • Press CTRL+K and then CTRL+L to erase all bookmarks in the current document.

Note To delete a single bookmark, click the line that has the bookmark and press CTRL+K twice.

Incremental Search

Using incremental search is often a good way to navigate to another location in the current document. You can search a single document or window by entering text character by character to locate text as the characters accumulate.

To navigate using incremental search

  1. On the Advanced submenu (Edit menu), click Incremental Search or press CTRL + I.

    The cursor icon changes to a binocular with an arrow, indicating the search direction, and the status bar displays "Incremental Search:".

    Note Incremental search uses the last setting choice for the Match case option located in the Find or the Replace dialog box.

  2. Type your search string to move to another location.

  3. The status bar displays the text you are entering while the editor highlights the first occurrence that matches the text. As you continue typing, the editor moves to the next match and highlights it. If no matches are available, the status bar displays "Incremental Search: <text> (not found)".

    Note Incremental search does not apply to text that has been collapsed or concealed. Also, regular expressions and wildcards are not available for use in incremental search text.

  4. Click Navigate Backward to return to where you were working before you used incremental search.

Use the following key combinations when you search incrementally.

To | Use
Stop incremental search | ESC
Remove a character from the search text | BACKSPACE
Change the direction of the search | CTRL+SHIFT+I
Move to the next match for the search text in the file | CTRL+I

Go To Line command

Use the Go To Line command to go to a specific line number.

To go to a specific line number

  1. Click Optionson the Tools menu and navigate from the Text Editor tab to the General page of the All Languages folder.
  2. Click Line numbers.
  3. Click Go To on the Edit menu.
  4. Enter the line number you want to view and click OK.

Navigate Backward / Navigate Forward buttons

Use the Navigate Backward button to navigate to previously visited locations in the document, and then use the Navigate Forward button to return afterwards. These buttons are particularly useful when using commands that take you far away from where you are currently working and you want to return to that location quickly.


Navigating in the Document Outline Window

While you are editing an HTML page, the Document Outline window displays a nested, hierarchical view of the elements and scripts on your page. You can scroll through the outline, collapse and expand entries, and double-click items to navigate quickly to their location in your document.

Note To open the Document Outline window, point to Other Windows on the View menu and click Document Outline. Click the plus (+) sign next to a node to list all the items within the node. A minus (-) sign indicates that a node is already fully expanded. Click the minus (-) sign to collapse the node.

To jump to an element in Design View

  • In the Document Outline window, double-click any element listed in the expanded <BODY> outline.

    In the document window, the insertion point jumps to that element.

To open the Document Outline window in Script Outline view.

  1. Open your page in HTML View.
  2. Point to Other Windows and click Document Outline.

    The Document Outline window opens in Script Outline view. The available outlines displayed include Client Objects & Events and Client Scripts.

To jump to an event handler call in the <BODY> of your page

  1. Open the Document Outline window in Script Outline view.
  2. Expand the Client Scripts outline.
  3. Double-click any object.event item listed.

    The insertion point jumps to the event handler call for this event in the markup for the element named.

To jump to an existing handler function in a <SCRIPT>

  1. Open the Document Outline window in Script Outline view.
  2. Expand the Client Scripts outline.
  3. Click the desired script to expand its list of functions.

    Scripts included in the Client Scripts outline are named for their scripting language.

  4. Double-click any function and the insertion point jumps to that function.

To insert a new blank handler function into a <SCRIPT>

  1. Open the Document Outline window in Script Outline view.
  2. Expand the Client Objects & Events outline.
  3. Double-click an object to expand the list of its available events.

    Events for which you already have a handler function are formatted bold.

  4. Double-click an event that is not bold.

    This inserts a new blank function that will handle the event.

    Note This new handler function is added to a script in the <HEAD> of your page whose ID property includes "clientEventHandlers." For example:

    <SCRIPT ID=clientEventHandlersJS LANGUAGE=javascript>

    If such a script does not already exist, one will be created.

  5. Complete the new event handler function you've just added.


Searching and Replacing

You can find and replace text using a variety of techniques. For example, you can use the Find and Replace dialog boxes. You can also search without a dialog box by using incremental search, or by using the Find box of the Standard toolbar. These techniques allow you to control the scope of find and replace and to choose the method of reviewing search matches and replacements.

You should consider the following information when you search and replace text:

  • Options set in the Find or the Replace dialog box are global. That is, certain options selected in one dialog box are selected for all the dialogs. These options are Match case, Match whole word, Search All open documents, Wildcards, and Regular Expressions. This rule also applies to the Find box.
  • Undo is available only for documents left open after a replace operation.
  • Undo for a replace all operation that spans more than one file is considered a single, bulk action across all the affected files that were left open.
  • Generally, you cannot search items with graphical structural views, such as Design View of the Script Editor.

Wildcards

The following expressions can replace characters or digits in your search string.

Note You must choose the Use check box in the Find or the Replace dialog box and select Wildcards before using any of the following as part of your search criteria.

Expression | Syntax | Description | Example
Any single character | ? | Matches any character |
Any single digit | # | Matches any single digit |
Characters not in set | [! ] | Matches any one character that is not specified in the set |
One or more characters | * | Matches any one or more characters |
Set of characters | [ ] | Matches any one of the characters specified in the set |

Regular Expressions

You can use the following regular expressions in the Find or the Replace dialog box to refine and expand your search.

Note You must select the Use check box in the Find or the Replace dialog box before using any of the following as part of your search criteria.

The following expressions can be used to match characters or digits in your search string:

Expression | Syntax | Description | Example
Any character | . | Matches any one character except a line break. |
Maximal-zero or more | * | Matches zero or more occurrences of the preceding expression. |
Maximal-one or more | + | Matches at least one occurrence of the preceding expression. |
Minimal zero or more | @ | Matches zero or more occurrences of the preceding expression, matching as few characters as possible. |
Minimal-one or more | # | Matches one or more occurrences of the preceding expression, matching as few characters as possible. |
Repeat n times | ^n | Matches n occurrences of the preceding expression. | [0-9]^4 matches any 4-digit sequence.
Set of characters | [] | Matches any one of the characters within the []. To specify a range of characters, list the starting and ending character separated by a dash (-), as in [a-z]. |
Character not in set | [^...] | Matches any character not in the set of characters following the ^. |
Beginning of line | ^ | Anchors the match to the beginning of a line. |
End of line | $ | Anchors the match to the end of a line. |
Beginning of word | < | Matches only when a word begins at this point in the text. |
End of word | > | Matches only when a word ends at this point in the text. |
Grouping | () | Groups a subexpression. |
Or | | | Matches the expression before or after the |. Mostly used within a group. | (sponge|mud) bath matches "sponge bath" and "mud bath".
Escape | \ | Matches the character following the backslash (\). This allows you to find characters used in the regular expression notation, such as { and ^. | \^ Searches for the ^ character.
Tagged expression | {} | Tags the text matched by the enclosed expression. |
nth tagged text | \n | In a find or replace expression, indicates the text matched by the nth tagged expression, where n is a number from 1 to 9. In a replace expression, \0 inserts the entire matched text. |
Right-justified field | \(w,n) | In a replace expression, right-justifies the nth tagged expression in a field at least w characters wide. |
Left-justified field | \(-w,n) | In a replace expression, left-justifies the nth tagged expression in a field at least w characters wide. |
Prevent match | ~X | Prevents a match when X appears at this point in the expression. | real~(ity) matches the "real" in "realty" and "really," but not the "real" in "reality".
Alphanumeric character | :a | Matches the expression ([a-zA-Z0-9]). |
Alphabetic character | :c | Matches the expression ([a-zA-Z]). |
Decimal digit | :d | Matches the expression ([0-9]). |
Hexadecimal digit | :h | Matches the expression ([0-9a-fA-F]+). |
Identifier | :i | Matches the expression ([a-zA-Z-$][a-zA-Z0-9_$]*). |
Rational number | :n | Matches the expression (([0-9]+.[0-9]*)|([0-9]*.[0-9]+)|([0-9]+)). |
Quoted string | :q | Matches the expression (("[^"]*")|('[^']*')). |
Alphabetic string | :w | Matches the expression ([a-zA-Z]+). |
Decimal integer | :z | Matches the expression ([0-9]+). |
Escape | \e | Unicode U+001B. |
Bell | \g | Unicode U+0007. |
Backspace | \h | Unicode U+0008. |
Line break | \n | Matches a platform-independent line break. In a replace expression, inserts a line break. |
Tab | \t | Matches a tab character, Unicode U+0009. |
Unicode character | \x#### or \u#### | Matches a character given by Unicode value where #### is hexadecimal digits. You can specify a character outside the Basic Multilingual Plane (that is, a surrogate) with the ISO 10646 code point or with two Unicode code points giving the values of the surrogate pair. |

The following table lists the syntax for matching by standard Unicode character properties. The two-letter abbreviation is the same as listed in the Unicode character properties database. These may be specified as part of a character set. For example, the expression [:Nd:Nl:No] matches any kind of digit.

Expression | Syntax | Description | Example
Uppercase letter | :Lu | Matches any one capital letter. | :Luhe matches "The" but not "the".
Lowercase letter | :Ll | Matches any one lower case letter. | :Llhe matches "the" but not "The".
Title case letter | :Lt | Matches characters that combine an uppercase letter with a lowercase letter, such as Nj and Dz. |
Modifier letter | :Lm |  |
Other letter | :Lo |  |
Decimal digit | :Nd | Matches decimal digits such as 0-9 and their full-width equivalents. |
Letter digit | :Nl |  |
Other digit | :No |  |
Open punctuation | :Ps | Matches opening punctuation such as open brackets and braces. |
Close punctuation | :Pe | Matches closing punctuation such as closing brackets and braces. |
Initial quote punctuation | :Pi | Matches initial double quotation marks. |
Final quote punctuation | :Pf | Matches single quotation marks and ending double quotation marks. |
Dash punctuation | :Pd | Matches the dash mark. |
Connector punctuation | :Pc | Matches the underscore or underline mark. |
Other punctuation | :Po | Matches commas (,), ?, ", !, @, #, %, &, *, \, colons (:), semi-colons (;), ', and /. |
Space separator | :Zs | Matches blanks. |
Line separator | :Zl | Matches the Unicode character U+2028. |
Paragraph separator | :Zp | Matches the Unicode character U+2029. |
Non-spacing mark | :Mn |  |
Combining mark | :Mc |  |
Enclosing mark | :Me |  |
Math symbol | :Sm | Matches +, =, ~, |, <, and >. |
Currency symbol | :Sc | Matches $ and other currency symbols. |
Modifier symbol | :Sk |  |
Other symbol | :So |  |
Other control | :Cc | Matches end of line. |
Other format | :Cf | Formatting control character such as the bidirectional control characters. |
Surrogate | :Cs | Matches one half of a surrogate pair. |
Other private-use | :Co | Matches any character from the private-use area. |
Other not assigned | :Cn |  |

In addition to the standard Unicode character properties, the following additional properties may be specified. These properties may be specified as part of a character set.

Expression | Syntax | Description | Example
Alpha | :Al | Matches any one character. | :Alhe matches words such as "The", "then", and "reached".
Numeric | :Nu | Matches any one number or digit. |
Punctuation | :Pu | Matches any one punctuation mark, such as ?, @, ', etc. |
White space | :Wh | Matches all types of white space, including publishing and ideographic spaces. |
Bidi | :Bi | Matches characters from right-to-Left scripts such as Arabic and Hebrew. |
Hangul | :Ha | Matches Korean Hangul and combining Jamos. |
Hiragana | :Hi | Matches Hiragana characters. |
Katakana | :Ka | Matches katakana characters. |
Ideographic/Han/Kanji | :Id | Matches ideographic characters, such as Han and Kanji. |