OpenDocuments.ViewDocument3 Method

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

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)



An expression that returns an OpenDocuments Control object.


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


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


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




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


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


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


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.


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


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.