I have the following issue with some office documents I'm creating programmatically. Here are some insights:

  1. The document is in Office >= 2010
  2. I'm reading an office word document which is located in another document library, then I parse it with the open xml document api in order to remove al its embedded metadata, then I save the new document in the target library.
  3. Target libraries have their check in / out (versioning) disabled (the library is created declaratively, checked the versioning settings just to make sure)
  4. The document is opened by one user at all times.

So the basic creation process is as follows:

  • The user picks up a "template" (which is the original word document)
  • The user writes a document name for the new document and presses the "generate button"
  • Then a javascript function calls a scriptable web service which does all the "magic" described previously
  • The web service returns to the browser the document path (url)
  • The browser calls editDocumentWithProgID2(result, '', 'SharePoint.OpenDocuments', '0', '', '0'); to open the new document so the user can begin editing

Unfortunately, when the user tries to save the document office pop ups the following error message (before you say its an OS X bug, no, it happens in the latest office builds for windows too):

enter image description here

Any ideas what might be happening?

EDIT: adding code for more insight

Here's the code sample https://gist.github.com/jjaramillo/5605d069de25753005f7

  • Can you show some insight about code using which you are generating document? because it may be possible that you have not disposed/closed memorystream/binary after saving document? – Kalpesh Vaghela Jun 12 '15 at 5:21
  • Edited the question with the link to the sample code on github – Jaime Jun 25 '15 at 22:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.