Export (0) Print
Expand All
2 out of 2 rated this helpful - Rate this topic

OpenDocuments.EditDocument Method

Published: May 2010

Opens the specified document for editing with its associated application or with the specified editor.


expression.EditDocument(bstrDocumentLocation, varProgID)

expression

An expression that returns an OpenDocuments object.

bstrDocumentLocation

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

varProgID

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

true if the document was successfully opened; otherwise false.

The following example uses the EditDocument method to open a specified document for editing. The example assumes the existence of a form named frmEditDoc that has two input boxes, EditFile and FileProgID.

<SCRIPT language="JavaScript">
function EditDocWithProgID()
{
    EditDocumentButton = new ActiveXObject("SharePoint.OpenDocuments.2");

    if (EditDocumentButton)
    {
        var strDocument = document.frmEditDoc.EditFile.value;
        var varProgID = document.frmEditDoc.FileProgID.value;

        EditDocumentButton.EditDocument(strDocument, varProgID);
   }
}
</SCRIPT>
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.