OpenDocuments.ViewDocument3 Method

Applies to: SharePoint Foundation 2010

Opens the document for reading instead of editing, so that the document is not locked on the server in a specified window, and with a specified type.

expression.ViewDocument3(pdisp As Object, bstrDocumentLocation As String, OpenType As Long, varProgID)

Parameters

expression

An expression that returns an OpenDocuments Control object.

pdisp

An Object that represents the window from which the ViewDocmument3 method is being activated.

bstrDocumentLocation

A string that contains the URL of the document to open for reading.

OpenType

A Long integer that specifies the rights for opening the document. The following table shows possible values.

Value

Description

0

When checked out, or when the document library does not require check out, the user can read or edit the document.

1

When another user has checked it out, the user can only read the document.

2

When the current user has checked it out, the user can only edit the document.

3

When the document is not checked out and the document library requires that documents be checked out to be edited, the user can only read the document, or check it out and edit it.

4

When the current user has checked it out, the user can only edit the local copy of the document.

varProgID

An optional string that contains the ProgID of the application with which to open the document. If this argument is omitted, the default viewer for the document is used.

Return Value

true if the document was successfully opened; otherwise false.