0

How to do a mail merge in asp.net without installing word on the server?

any dlls or any components available?

Edits

The template document is already available. im not trying to create a word document. Just want to link the word document with the data.

Thanks

2
  • Do you have a requirement to use MS Word? Can you use other products? Commented Mar 24, 2011 at 21:38
  • Hi Mike, Thanks for the response. Yes. The requirement from teh client is to use msword. any suggestions? Commented Mar 24, 2011 at 21:40

4 Answers 4

2

Personally, I would just look at using the System.Net.Mail class and its templating abilities. There is a nice library here: https://github.com/lukencode/FluentEmail which you can pass templates into and send emails that way with the data you require inserted into it.

EDIT: noticed you didn't actually specify whether it was print mailmerge or email, apologies if it is a print mailmerge you are trying to create, but for mass emailing with customized data in it, templating is definitely the way to go.

Sign up to request clarification or add additional context in comments.

1 Comment

I'm not going to mail anything. There will be a form. The user will enter comments in teh form. thsi should be populated in a letter in word and let the user download the word document.
1

To accomplish the Word doc creation part of the question there is a previous thread about this: How can a Word document be created in C#?

To send the completed doc check out the System.Net.Mail namespace: http://msdn.microsoft.com/en-us/library/system.net.mail.aspx or if you can afford it I have had great experience with http://www.aspnetemail.com/.

2 Comments

True, not 100% same but the greatest difficultly is creating the Word document without Word. I'll edit my answer.
Hi Paul, Thanks for your answer. I'm not going to create word doc in .net. the doc will already be there. I'm just going to add data to the doc and let the user download it.
0

We use Aspose.Words to perform mail merges from .net code. It's not cheap but once you get to grips with it it's very powerful.

Edit: I'm assuming you are looking to merge data from some sort of data store into a template word document which can be printed and distributed.

2 Comments

HI Andy, Thanks for the answer. You are right about my requirment. But this one seems to be too expensive. Any economical ones?
Hi Vivek, I'm afraid aspose is the only one I'm aware of. I did find this question though stackoverflow.com/questions/435323/aspose-word-alternatives. Sorry I can't be of more help.
0

Another option is Docentric Toolkit. It is pure .NET and based on OpenXML without any dependency on MS Word, so it is a good fit for server side report generation.

Merging with data is done through placeholders, which get filled up with data at run time. Data can come from database or XML.

Templates are created in MS Word which needs Docentric Toolkit add-in installed (license is needed).

It is really easy to create templates and to merge them with data from .NET code.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.