Nintex Connect

The Official Community Site for Nintex Software Products, including Nintex Workflow 2007, Nintex Podcast 2007 and Nintex SmartLibrary.
Welcome to Nintex Connect Sign in | Join | Help
in Search

Editing a document by default instead of Read-Only mode

Last post 07-23-2010, 9:43 AM by jakub@jakuburban.cz. 6 replies.
Sort Posts: Previous Next
  •  02-04-2010, 5:16 AM 8666

    Editing a document by default instead of Read-Only mode

    Hey guys,

    We have a workflow that creates a new Word document every time it is started.  The document is based on a template we've uploaded to the Sharepoint Document Library, and it needs to be filled out each time a workflow is run.  The problem is that, by default, when a user clicks on the document, it opens in read-only mode.  We've had trouble with users not even being able to edit the document if they click the drop-down on the document in the Document Library and select "Edit document in Microsoft Word".  We found a fix to be a a registry edit, but that's not a solution we want to use.  It would have to be done on all of our users' workstations, and we will potentially have a couple hundred computers, most not on our network.  My co-worker sent me this page as a possible solution: http://dotnetninja.wordpress.com/2009/01/12/how-to-open-sharepoint-documents-in-edit-mode-with-internet-explorer-6-and-windows-xp-without-regfix/

    However, we don't want to use a custom web application, since everyone is on sharepoint.  So, what I did was I edited a Nintex Edit form in the Workflow Tasks list to have a Sharepoint:FormField which pulls in a certain column's value from the task.  I set the task's column value from the Document Library's workflow, and it passes into the form fine.  I now can link from the Edit form.  The problem I run into is that I tried taking the javascript from the above web page and including the functions editDocumentWithProgID2 and editDocumentWithProgIDNoUI in the edit page.  Then, in the FormField I passed in an html link with it's href set to the big string calling the editDocumentWithProgID2, which looked like <a href=java script:editDocumentWithProgID2('/site/list/document.doc', '', 'SharePoint.OpenDocuments', '0', 'http://site/list', '0')">Testing</a> where my site names and documents were replaced for "site/list" etc.  I thought I had it, but then found out that when Sharepoint loads those pages, it strips the javascript out of text fields like that.

    I haven't been able to find a way around this, and fear I've done all this work just to have hit a dead end.  Can anyone help?

    Thanks!
    Paul 

  •  02-04-2010, 6:15 AM 8668 in reply to 8666

    Re: Editing a document by default instead of Read-Only mode

    Hi Paul,

    email sent you from the Nintex Support desk.  If it helps, we can update the forum thread.

  •  02-09-2010, 1:52 AM 8761 in reply to 8668

    Re: Editing a document by default instead of Read-Only mode

    Vadim,

    Thanks so much for your suggestion!  It does work now, and opens the documents in edit mode by default.  For those of you having this trouble, here's Vadim's solution:

    In steps 1 and 2, you need to confirm that ALL of your front-end Web servers contain the file OpenDocForEdit.aspx within the c:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\TEMPLATE\LAYOUTS\NINTEXWORKFLOW directory.  If they do not, then you will need to deploy the file to each front-end Web server.

    For step 3, you are just confirming that the OpenDocForEdit.aspx file is NOT read-only.

    Once completed, step 4 outlines how to construct the link so that your List attachment is editable from the link.

    1.       Download the file at http://download.nintex.com/sl/supportfiles/OpenDocForEdit.zip.
    2.       Deploy the OpenDocForEdit.aspx (in zip file) to each front end web server in the c:\program files\common files\microsoft shared\web server extensions\12\template\layouts\nintexworkflow directory
    3.       Confirm the OpenDocForEdit.aspx is NOT read only by right clicking on the file and choosing properties to verify the Read Only option is not ticked
    4.       Configure your URL in the workflow notification to have an address section similar to this
    :

    Web Url
    /_layouts/nintexworkflow/opendocforedit.aspx?doc=Item Url&page=Web Url
     
    The parameters / options are:
    “doc=” the URL to the word document that is to be opened in edit mode
    “page=” the URL to the page to redirect to once the document is open [optional]
    “close=true” closes the page once the document is open [optional]. The Page= option overrides this option

    I didn't use the Page or Close options, since I am using this new address in place of my string in my first post with the java script code in it.  I'm getting it to the Edit Form by setting it in my variable in the document library workflow, which sets the document library column, workflow tasks list column, and then is pulled into the Edit Form by the Sharepoint:FormField element.  I wanted them to have the link to the document on the task page where they can click Complete Task after they are done filling the form out and saving it.  By leaving those 2 options out (Page and Close) it will stay at the Task page for them.

    Again, thank you very much for your help, and if anyone has questions on what I meant in any of my descriptions, let me know.

    Thanks,
    Paul

  •  02-09-2010, 1:58 AM 8762 in reply to 8761

    Re: Editing a document by default instead of Read-Only mode

    Vadim,

    I forgot to ask one thing.  I actually already had a file called OpenDocForEdit.aspx in that folder.  I backed it up and copied the one I downloaded from your link, but the one I had was actually newer.  Do you know why this would be?

    Thanks!
    Paul

  •  02-11-2010, 6:37 AM 8816 in reply to 8762

    Re: Editing a document by default instead of Read-Only mode

    One important thing to note:

    I ran into a problem with sharepoint when using the above solution, and it dealt with my custom Edit Task form.  As I had stated earlier, the task form has a link to a document the users need to fill out and save.  This is the only place where they'll have the link to the document.  The problem I ran into when using this solution is that when I would click on the link to open the document, it would navigate away from the Edit Task form, to the OpenDocForEdit.aspx page, which in turn would open the word document.  The problem with this was that when the user would fill out the form, save it, and close it, they couldn't find the Edit Task form.  In order to get back to it, they needed to click Back on their browser.  As a short term fix, I could just instruct them to do so, but it wasn't a nice solution, since I would prefer to take all needed user actions out of the equation, and have as much automated as possible.

    My first attempt at a solution:
     I tried changing the html for the link to have a target="_blank" and then use the  OpenDocForEdit.aspx page parameter ?close=true.  My thinking was that if it opened in a whole new window, and that window would auto-close, it would be perfect!  This did not work though.  It would close the window from the parameter close=true, but the target="_blank" was not working.  My first thought, and worry, was that Sharepoint was stripping out the code.

    The solution:
     I found out that Sharepoint was not stripping out the code for security reasons, but the column that I was storing the html code in was a multi-line Rich Text column, and IT was responsible for the link not working.  It was seeing the actual URL in my html tag of <a href=... etc. and making it into a link.  The other part of the html tag (target="_blank") was being ignored.  So, when the form was using the link, it was never seeing the additional code.  After switching the column to Enriched Text, it now works great!  I can follow the link in the email notification to the Edit Task form, click on the link to the document, and it opens in a new IE window, and closes automatically.

    Also important is to use all lower case in your html!  I tried ?Close=true, and it did not work.  However, ?close=true does.

    Thanks!
    Paul

  •  02-12-2010, 2:16 AM 8838 in reply to 8816

    Re: Editing a document by default instead of Read-Only mode

    Hi all,

    This OpenDocForEdit.aspx file is now deployed with the product and is the one that should be used.

     

    You should NOT modify the file already on disk that is shipped with the product as this could cause issues with future upgrades.

     

  •  07-23-2010, 9:43 AM 11930 in reply to 8838

    Re: Editing a document by default instead of Read-Only mode

    Hi, just for information. When this link is used for opening the DOC and there are no Office on the computer installed, the link doesn't work.

    The standard behaviour of IE when you don't have associated app is to download file, but with this link without Office, you are not able to open standard "File Download" dialog.

    Regards,

View as RSS news feed in XML
Powered by Community Server, by Telligent Systems