Click here to Skip to main content
15,909,437 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
Hi,

I want to create Doc file without microsoft interop dll using c#.

is there any 3rd party dll or other way of doing so??

thanks
Posted
Comments
Zoltán Zörgő 18-Jun-13 8:16am    
Of course. You can use google to find several components. If you want docx, you can also do it directly, since it is an open format - not like legacy doc.

Yes, there is, and, if you would agree on .docx, not even necessarily 3rd-party.

First of all, this is a good idea to avoid using the Office interop. Please see this Microsoft article warning you about it: http://support.microsoft.com/default.aspx?scid=kb;EN-US;q257757#kb2[^].

Alternatively, you can use Microsoft Open XML SDK:

http://www.microsoft.com/en-us/download/details.aspx?id=30425[^].

This way, you can support new XML-based Office formats (such as .DOCX, .XLSX), ECMA-376 standard:
http://en.wikipedia.org/wiki/Microsoft_Office_XML_formats[^],
http://en.wikipedia.org/wiki/Office_Open_XML[^].

Also, the documents are supported by 3rd-party software. Please see my past answers:
Convert Office-Documents to PDF without interop[^],
Need a rather unique WPF text editor control[^],
Hi how can i display word file in windows application using c#.net[^],
Read a word file without using Interop.word dll...Do not want to install word in IIS..[^].

This is another option: http://npoi.codeplex.com/[^].

—SA
 
Share this answer
 
Depending on the doc type you want to create, you can use ReportViewer RDLC report format which is free and made by MS guys. You can create a RDLC report and then fill it with whatever you want and export it to Word doc format through code. Here is a sample code Exporting to Word/PDF using Microsoft Report (RDLC) without using Report Viewer.[^]

Again, all depend on what kind of document you want to create but it is a good alternative. HTH
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900