User friendly Mail Merge application using MS SQL and MS Word in ASP.Net and VB

Posted on 2009-05-24
Medium Priority
Last Modified: 2013-11-10
I have a MS SQL 2005 table and a MS Word 2003 document.  It's part of a project already done in ASP.Net 3.5/VB/SQL.

I've got the mail merge fields set up in the Word document to pull the appropriate fields from the SQL Server database, so I can print the whole mail merge in one shot if I want.
But, since the rest of the project is in ASP.Net and the users do not know how to use the mail merge in Word effectively I'd like to make a simple ASPX page with a DropDownList control so the user can select one record to print or perhaps a range.  
I have used SQL queries in DropDownLists before, but I don't know how I would get the data to the Word mail merge that way.
There are probably multiple ways to do it, but I'm looking for "simple".  I'm a novice programmer, so telling me "Create a DataSet and link it to Word" won't help me at all.  I really need an example.
Say, the SQL table contains the fields [LastName] and [Address].
Thanks for any help.
Question by:megnin
  • 3
LVL 15

Expert Comment

ID: 24463684
You have your ASP.Net page producing a Word Document already, but are wanting to be able to tweak the query that Word uses?


Accepted Solution

dipakdave1983 earned 2000 total points
ID: 24464469
if your word does not contain the images then you can do this way,,,


Author Comment

ID: 24472478
Hi Rob.  No, it's the ASP.Net page I'm looking for how to create.  I don't know how to get one single record from say, a DropDownList to a Word document or template, like a form letter so the user can select a person's record from the DropDownList and fields from that record will populate the form letter (Word doc).
I know how to mail merge from the database into Word, but I don't know if some form of that technology is what I should use or if there's another method, like how Excel pulls data from a database.

Author Comment

ID: 24472511
Hi dipakdave1983.  Dave, that link looks very informative, but it may be a little more complicated than I want to get into.  If it's no easier than that I'll just teach the users how to use the Mail Merge in Word and let the do it 'the old fashion way'.  ;-)

Author Closing Comment

ID: 31584807
I'm sure that's a good solution.  I was hoping, however, for one that I would be able to use.  It seems that the Microsoft solution for even the simplest task is much more complicated than it seems that it should be.

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
The SignAloud Glove is capable of translating American Sign Language signs into text and audio.
Starting up a Project
Stellar Phoenix SQL Database Repair software easily fixes the suspect mode issue of SQL Server database. It is a simple process to bring the database from suspect mode to normal mode. Check out the video and fix the SQL database suspect mode problem.

600 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question