Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Programmatically create MS Word file without having MS Word installed

How can I create Word files in C# using Visual Studio 2008, without Word on my PC?

Do I need to have Word installed on my PC, to be able to create Word files using Visual Studio 2008?

Thanks in advance!

like image 450
user198003 Avatar asked Nov 17 '10 20:11

user198003


People also ask

Can I get MS word on its own?

Yes. You can buy standalone versions of Word, Excel, and PowerPoint for Mac or PC. Go to the Microsoft Store and search for the app you want. You can also get a one-time purchase or a subscription version of Visio or Project, available for PCs only.


1 Answers

You can use the Open XML Format SDK:

The 2007 Microsoft® Office system introduces a new file format that is based on XML called Open XML Formats. Microsoft Office Word 2007, Microsoft Office Excel® 2007, and Microsoft Office PowerPoint® 2007 all use these formats as the default file format.

Open XML formats are useful for developers because they are an open standard and are based on well-known technologies: ZIP and XML. Microsoft provides a library for accessing these files as part of the WinFX technologies in the System.IO.Packaging namespace.

The Open XML Format SDK is built on top of the System.IO.Packaging API and provides strongly typed part classes to manipulate Open XML documents.

like image 63
Joey Avatar answered Nov 02 '22 23:11

Joey