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 am trying to open a word document but it doesn't work as i can only save the document, not open it.

I'm getting the error below when trying to open a document: enter image description here

Do i need to make any changes to something so that users are able to open document in SharePoint?

Right now i am only able to save the document.

object missing = Missing.Value; 
object start1 = 0;

var wordApp = new Microsoft.Office.Interop.Word.Application();

var myDoc = wordApp.Documents.Add(ref missing, ref missing, ref missing, ref missing);

object doNotSaveChanges = WdSaveOptions.wdDoNotSaveChanges; 
Range rng = myDoc.Range(ref start1, ref missing);

const char newLine = (char)11; 
myDoc.SaveAs(ref fs, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing); 

myDoc.Close(ref doNotSaveChanges, ref missing, ref missing);

wordApp.Quit(ref doNotSaveChanges, ref missing, ref missing);
share|improve this question

In order to use Office Interop, in your case for Word automation you would need to have Office installed on the Server - it looks like the code you are trying is actually failing due to missing of assemblies.

It is not at all recomanded as strategy, but rather the use of OpenXML SDK 2.0 - compatible with SharePoint 2010 (or v2.5 for SharePoint 2013) - you files must be saved as .docx

OpenXml can allow manipulation of most Office files, and for Server environments it could be very well combined with Word Automation Services which allow for conversion of Word documents towards other formats.

share|improve this answer

You have to check DCOM-setting in Component Service console of windows server. Find there Computers->My Computer->DCOM Config->Microsoft Office Word Document->Identity and set it to The launching user

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.