Click here to Skip to main content
15,615,016 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:

Please anyone suggest me with following scenario.

I have a template document (template.doc) with mail merge (Merge field) option. I have to convert this document (template.doc) to excel file along with the mail merge option. How to do this? Also the converted template (.xls) should look like the same as in document template (.doc) in font size, color, header, footer, image and merge field. How to achive this. Please suggest me with sample or some URL where i can find some good solution to do this.

Note: Here i am just creating the Merge field (place holder) alone in the excel template, no need for merging the data. It's done is another phase, so no need to workout with that here.

Thanks in advance.

1 solution

There isn't any direct way to do it with CSharp.
You need to use Interoperability[^] for that.

I have found two useful articles on that.
Microsoft Word Documents from ASP.NET[^]
Using C# to Create an Excel Document[^]

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