OpenXMLDocuments.ViewDocument2 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 specified XML document or form in a specified window for reading instead of editing, so that the document is not locked on the server.

expression.ViewDocument2(pdisp As Object, bstrDocumentLocation As String, varProgID)



An expression that returns an OpenXMLDocuments Control object.


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


A string that contains the URL of the location of the XML document or form to open for reading.


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.

See Also


OpenXMLDocuments Control

OpenXMLDocuments Members