Open Method

Microsoft Office Object Model

Show All

Open Method

       

Opens the specified HTML project or HTML project item in the Microsoft Script Editor in one of the views specified by the optional MsoHTMLProjectOpen constants listed below. If one of the constants is not specified, the project item is opened in the default view.

expression.Open(OpenKind)

expression   Required. An expression that returns one of the objects in the Applies To list.

OpenKind  Optional MsoHTMLProjectOpen. The view in which the specified project or project item is opened.

MsoHTMLProjectOpen can be one of these MsoHTMLProjectOpen constants.
msoHTMLProjectOpenSourceView
msoHTMLProjectOpenTextView

Remarks

The default view is determined by whether or not the Microsoft Script Editor is open when the Open method is executed. If the Script Editor is not open, the Open method starts the Script Editor in source view. If the Script Editor is already open, the Open method activates the Script Editor and displays the script in the current view.

Example

This example opens the HTML project in the active workbook in source view.

AppActiveWorkbook.HTMLProject.Open _
    (msoHTMLProjectOpenSourceView)

This example opens the first HTML project item in the active workbook in text view.

ActiveWorkbook.HTMLProject.HTMLProjectItems _
    Item(1).Open (msoHTMLProjectOpenTextView)