By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,524 Members | 1,519 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,524 IT Pros & Developers. It's quick & easy.

Mail merge from DataSet

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
"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.