Open Method

Home Page (Objects)OverviewFAQReference

Applies to: Documents object

Opens a document with a specified file name.

Syntax

object.Open PathName[, OpenAs ][, ReadOnly]

Parameters

object

An expression that evaluates to a Documents object.

PathName

A String that specifies the full path to the document.

OpenAs

(Optional) A Variant that is a String specifying the document type when the document opens. Possible values are:

ReadOnly

(Optional) A Variant that is a Boolean specifying whether the document is read-only. Possible values are:

Example

The following example opens the macro file C:\ Program Files\Microsoft Visual Studio\Common\MSDEV98\Macros\Sample.dsm as read-only:

Documents.Open "C:\Program Files\Microsoft Visual Studio\Common\MSDEV98\Macros\Sample.dsm",,True

See Also   Close method, CloseAll method.