This code snippet shows how to convert a Microsoft Office Word document to other document formats such
PDFs, HTML, Rich Text Format (RTF), Text, XML, xps. We are going to use Office Interoperability for this purpose.
Download the Primary Interop Assemblies (PIAs) from following links.
MS Office 2007
MS Office 2010
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=938fe8ad-583b-4bd7-a345-23250dc15855
Adding the references.
-
Right click on your project.
-
Select Add Reference.
-
Go to .Net tab.
-
Select Microsoft.Office.Interop.Word from list.Samples attached using MS Office 2010 PIAs.
Sample codes attached. If you have any questions, post them below.

Sr KarthigaPosted Jul 7, 2016, 7:03 AM
Good one
Sangeetha MohanPosted May 4, 2016, 9:03 AM
Hi Suthish,I have a similar requirement provided that my word document/template contains content controls(mainly textboxes) which i want to convert to html file reflecting those textboxes and I strictly should not make use of Interop. Please suggest me some free dll if u have any idea.
Suthish NairPosted May 25, 2015, 12:04 PM
The reasons can be many, like did you copied all references properly to server, did the required office version installed on server, try reinstalling again, did the application folder have required permissions. Check the sever version and the version showing in config file matches etc...
sumit jaiswalPosted May 25, 2015, 4:45 AM
please tell me what i do?
sumit jaiswalPosted May 25, 2015, 4:44 AM
hi this project work only local host when it is uploaded on server it gives Could not load file or assembly 'Microsoft.Office.Interop.Word, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies
Former memberPosted Nov 20, 2013, 2:40 AM
You can convert word document to any other formats even to ones you have mentioned by using Aspose.Words for .NET : http://www.aspose.com/.net/word-component.aspx
Mithila MestryPosted Apr 12, 2013, 12:57 AM
I m using same functionality in windows store app but its giving me below error (Creating an instance of the COM component with CLSID {000209FF-0000-0000-C000-000000000046} using CoCreateInstanceFromApp failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)). Please make sure your COM object is in the allowed list of CoCreateInstanceFromApp.)
Suthish NairPosted Mar 7, 2013, 3:10 PM
now days everyone going for openxml. No installation required.
Sreenivas EemaniPosted Mar 3, 2013, 1:07 AM
will it work without installing MS WORD in server?
zarfishan zahideditedPosted Nov 1, 2012, 12:42 AMEdited Nov 1, 2012, 12:45 AM
Try Saaspose Word Converter (http://saaspose.com/api/words) it can convert your word documents to many other formats and also allows you to create document from scratch.
vikramPosted Jul 3, 2012, 8:51 AM
without ms word installing it will not work.
vikramPosted Jun 28, 2012, 7:05 AM
Can we run this application without installing MS word on machine ?
vijay ragsPosted Mar 7, 2011, 8:44 AM
Thanks for that. I already used it.But the Client side dont have any ms office suite installed. So i tried with "MS Office" viewer. I think its a freeware and just installed in client machine will help them to view/Print the document with one Constraint that it has to installed on all machine in the Client Side. Like that is there any other option that can be installed in Server and shared with the Client Machine that connect to that Server. Thanks,
PeterPosted Sep 11, 2010, 3:47 AM
Hi, I have a large number (2000+) of word files from my Mac (MS Word 2004 for Mac) that I have transferred to my XP machine. I wish to open them in a c# 2010 express application that I am developingg. I have Office 2010 installed on that machine also. I have used your suggestions to open the files. If I open them first in Word 2010, then my application will open them fine. If I attempt to open them direct (after changing the extension to .doc), I get an InteropServices.COMException. Any ideas? Thanks, Peter