I am modifying Word and PDF documents when they are uploaded to a document library with an event receiver.

ItemAdded runs perfect without any errors, I manipulate the documents and save them to library but the users receive an error stating that the document is modified by the SharePoint\System user.

What is the best way to modify the documents as soon as they are uploaded to the library?


  • what kind of modifications you do in event receiver? Nov 14, 2011 at 10:49
  • Opening the word document with Open XML SDK and putting a dynamically generated string into it's footer and saving the document back. Nov 14, 2011 at 10:54

2 Answers 2


Maybe you have to register the ItemAdded event as Synchronous event. See this answer how to do it: Race condition in SPListEventReceiver.ListAdded - Save Conflict

  • This is more of an unexpected modification imo. The user clicks Add new document button, chooses the file to upload and clicks ok button. In the background, the file is uploaded, my event reciever runs and stamps the document. At the same time, user is shown the second SharePoint upload document dialog in which the user fills the title etc. As soon as the user click ok, she gets an error saying the document is modified by someone else. Nov 14, 2011 at 11:21
  • by default, your event receiver works from system account, thus, file is modified and there is change conflict, that's why the error message is shown. Nov 14, 2011 at 11:55
  • The problem is that your ItemAdded event is Asyonchronous: It modifies the document after/while the user is shown the edit properties dialog of the file. If the ItemAdded event would be Synchronous, then the ItemAdded event modifies the document before the user is shown the edit properties dialog and everything should work fine.
    – Matthias
    Nov 14, 2011 at 13:06

ItemAdded works in asynchronous way after an item is added. If ItemAdded hasn’t finished with its work(or is in queue) and user tries to checkout or edit documents ,they may get this error

Use SPListItem.SystemUpdate(false) instead of SPListItem.Update() in the list Item related to SPFile.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.