SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to Open and modify a document that resides on a Sharepoint Document Library.

These changes on the file are done during an event generated by a Document Library, so I must change it by code.

Is there any way to do that? I tried to use Microsoft.Office.Interop.Word but without success.

Thank you very much

share|improve this question
up vote 3 down vote accepted


OpenXML SDK is what you are looking for, OpenXML SDK can help you edit and create word, excel and other documents programmatically and it works great with SharePoint!

Following links can help you:
Modifying Open XML Documents using the SharePoint Object Model
SharePoint and OpenXML

ERIC White has written many articles on SharePoint with OpenXML:

I hope this helps

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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