Pages

Wednesday, December 16, 2009

How to open any documents in EDIT Mode from custom ASPX page

Requirement:

We need to display documents from SharePoint Document Library into custom ASPX page and when user clicks on documents, it needs to open in “EDIT” mode, by default it’s giving user prompt to open documents in “EDIT” or “READ” only mode.

Solution:


We need to put extra JavaScript code which will open document in EDIT mode.

Reference Links:

http://ddkonline.blogspot.com/2007/07/issues-with-sharepoint-2007-checkout.html

http://www.google.com/search?q=dispex+sharepoint

http://mattknott.com/content/blog/2009/08/Stop_DispEx_Redirecting.html

http://dotnetninja.wordpress.com/2009/01/12/how-to-open-sharepoint-documents-in-edit-mode-with-internet-explorer-6-and-windows-xp-without-regfix/

2 comments:

  1. Do you have an example of the script and how to use it?

    ReplyDelete
  2. Here is Script with example, you need to add below script into hyperlink or button control in which user is going to click for opening any documents.

    E.g.

    string str = "return editDocumentWithProgID2('http://localhost.com/spsite/docs/expense.xls', '', 'SharePoint.OpenDocuments.3', '0','http://localhost.com/spsite', '0');";
    ExcelIconHyperLink.Attributes.Add("onclick", str);

    Thanks,
    Sanket

    ReplyDelete