Click here to Skip to main content
15,886,059 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
My client has given me a requirement by using ASP.NET and C# code in to generate a word document dynamically by reading the contents from another master document template based on following conditions.

1. Capability of reading a master word document template and it will have 2 or 3 optional paragraphs

2. The output document (With around 10 pages) should be generated automatically with the paragraph numbers (such as 1, 1.1, 1.1.1 etc) according the inclusion and exclusion of optional paragraphs.

3. The output word document also should have the right margins and paragraph alingments, page breaks, paragraph and formats (as in master template)

Can we use Microsoft office assembly which is Microsoft.Office.Interop.Word in Microsoft word 2007?

Also suggest me any other assemblies Can I use to acheive this?

Any kind of Free word file handling components are payable components are also do.

It would be greate help , If you could provide me a sample code for this.

I am using Visual Studio 2005 Professional Edition, Win 7, IIS7, Microsoft office Enterprise 2007, .NET Framework SDKV2.0

Thanks
Rajan
Posted

1 solution

1. Yes, if Office will be installed where the application is being run, Interop will work.

A basic introduction to interop with Word.[^]

2. Office 2007 uses a format called Office Open XML (OOXML)[^]. The format can be edited without having Office installed. The OOXML format is a bunch of folders containing XML files, all zipped into one file with a docx (xlsx, etc) file extension. You can open an manipulate these files/folders directly.

3. You can use the OOXML SDK[^] as tool to manipulate the documents without all the work of #2.

4. There are commercial components available to manipulate these documents.
 
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