0
votes

I have a WCF service running on the sharepoint server that will generate a document in a library and return its uri. I have a client application that calls the WCF service and launches word with edit privileges of the document that was just generated. However if I just pass word the URI of the document it will open the document in Read-Only mode. Trying to save back to the server overwriting the old file gives the error saying the document is Read-Only when saving.

How do I, from code, launch word with the ability to save changes back in to the file it opened on the sharepoint server?

Note: This is not a permissions issue, if I manually go in to the sharepoint site I have rights to click on the document and open as edit.

EDIT: Ok, So I think I know how to do it (I am going to make a dll and have rundll.exe launch word and do the babysitting). However I still would like to know if there are any other solutions than manually checking in and out the document.

2
Are checkins enabled on the library? Are you checking the document out before opening it? - Kyle Trauberman
@Kyle, how to I check (via sharepoint designer if need be) if checkins are enabled? - Scott Chamberlain
@Kyle Trauberman, I think they enabled are but we are not using them. - Scott Chamberlain
See my answer. Because checkins are enabled, the read-only flag is set on the document when you open it. Checking the file out will clear the flag. - Kyle Trauberman

2 Answers

1
votes

I did not need to check out the document, what I found out is I needed to launch iexplore.exe pointing at the URI using the following code.

Process.Start("iexplore.exe", ((FileDetails)e.Result).Address);

where FileDetails is the custom object the WCF service is returning and .Address is the URI of the document.