467,917 Members | 1,397 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,917 developers. It's quick & easy.

Mail merge from DataSet

A contact management application we previously developed for a customer now
has a requirement to perform mail merging. Normally request like this would
be very simple to solve, we were just point the mail merge data source to
the database. But this request is a little bit different. The customer
needs to perform the mail merge from the contacts in a dataset.

Example
In the main contact window the client has the ability to filter contact is
based on various details. After performing a filter the contacts in the
dataset are limited or expanded based on the new filter. The customer then
needs to open a Word document and perform a mail merge with the contacts in
the current dataset. The customer will NOT be opening the Word document from
the application.

The only option I can see is is by adding a new tool button the customer
clicks to export the data to a new database of which, the Word document uses
as its data source.preferably, I do not want to export any data and would
prefer (if possible) to use the dataset directly.

Any thoughts and suggestions on this would be greatly appreciated.

Regards,
Mike

Nov 21 '05 #1
  • viewed: 4034
Share:
2 Replies
Hi Mike,

You're on the right track.

I do the very same thing and here's how I do it:

I zap an sql server table and then load it with the data from the filtered
dataset. The Word merge file is called through a macro that loads the table
in question and posts the data into each page, per client (or, in your case,
per contact).

So, when my client opens Word, he need only run the macro, which opens and
populates the merge file. I have taken it one step further with 'do you
wish to open Word now?' and if so, I call the macro directly from vb .net:

macroname_ = "/mwelcome"

longstringname_ = globalmsopath & "\winword.exe " & "f:\imcapps\docs\" &
mergeletterbox.Text & " " & macroname_

Shell(longstringname_, AppWinStyle.NormalFocus, False, -1)

HTH,

Bernie Yaeger

"Mike Stephens" <mi**************@yahoo.co.nz> wrote in message
news:Ow****************@TK2MSFTNGP09.phx.gbl...
A contact management application we previously developed for a customer now has a requirement to perform mail merging. Normally request like this would be very simple to solve, we were just point the mail merge data source to
the database. But this request is a little bit different. The customer
needs to perform the mail merge from the contacts in a dataset.

Example
In the main contact window the client has the ability to filter contact is
based on various details. After performing a filter the contacts in the
dataset are limited or expanded based on the new filter. The customer then needs to open a Word document and perform a mail merge with the contacts in the current dataset. The customer will NOT be opening the Word document from the application.

The only option I can see is is by adding a new tool button the customer
clicks to export the data to a new database of which, the Word document uses as its data source.preferably, I do not want to export any data and would
prefer (if possible) to use the dataset directly.

Any thoughts and suggestions on this would be greatly appreciated.

Regards,
Mike

Nov 21 '05 #2
"Mike Stephens" <mi**************@yahoo.co.nz> wrote in
news:Ow**************@TK2MSFTNGP09.phx.gbl:
I do not want to export any data and would
prefer (if possible) to use the dataset directly.


Crystal Reports - it's included with VS.NET.
--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Nov 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by campwes | last post: by
8 posts views Thread by Squirrel | last post: by
reply views Thread by Jereme | last post: by
1 post views Thread by =?Utf-8?B?QmFkaXM=?= | last post: by
1 post views Thread by =?Utf-8?B?QmFkaXM=?= | last post: by
1 post views Thread by =?Utf-8?B?VHJ1cHRpIERhbGlh?= | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.