473,401 Members | 2,125 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,401 software developers and data experts.

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
2 4265
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: campwes | last post by:
Hey, all. I'm trying to develop a C# app that creates Word 2003 mail merge documents with an Oracle 9i database as the datasource. I used the following as an example of how I can start out: ...
1
by: Lisa | last post by:
I have a query named QryDept where one of the fields is DeptID. The query is used for the data source of a mail merge letter. I would like to control which department is to get the mail merge...
8
by: Squirrel | last post by:
Hi everyone, I've created a mail merge Word doc. (using Office XP) , the data source is an Access query. Functionality I'm attempting to set up is: User sets a boolean field to true for...
3
by: Andy Davis | last post by:
I have set up a mail merge document in Word 2003 which gets its data from my Access 2000 database. I want to set up a button on a form that: 1. runs the query to provide the dat for the merge...
0
by: Jereme | last post by:
I am trying to do a mail merge from a Dataset or datagrid into MS Word. So far I have not luck in finding the exact salution to allow me to do this directly.
1
by: =?Utf-8?B?QmFkaXM=?= | last post by:
Hi, I'm trying to do mail merge to word document where the data source is from a database called "Cache" from intersystems using this code: public CacheConnection cnCache; string...
1
by: =?Utf-8?B?QmFkaXM=?= | last post by:
Hi, how can I use a dataset (as my datasource) to perform a Word Mail Merge? maybe methods like wrdMailMerge.OpenDataSource()!? or wrdMailMerge.DataSource...!? could help but I don't know how to...
1
by: =?Utf-8?B?VHJ1cHRpIERhbGlh?= | last post by:
Hi to all, I am new in this newsgroup and new to .NET also. I am creating an application where I have to perform Mail Merge from my program. I have created a form which contain RTB and user can...
0
by: truptidalia | last post by:
Hi, I am not that experienced in VB.NET. I am working on a application where i have to perform mail merge from the application. The application lets the userwrite letters, save them as rtf...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.