Mail merge from inter/intranet

C

Claus

Where is there a good cookbook example of some code that shows a mail merge
letter with the merge data comming from an internet response page.

I have an SQL database coupled with some web applications.

I would like the word document to be able to complete the following tasks
upon opening the document:

1. Display a dialouge box asking user to supply the record key ie: Client Id
or Client Name.

2. A macro queries the SQL database via the web apps. (a web app would be
provided to receive the key, then search and return the data/record to be
merged)

3. The macro would continue complete the mail merge.

This is fairly easy to do in excel and I see it is easy to just specify a
URL in the open file dialouge box, the problems comes with merging the
returned data with the document.
 
D

Doug Robbins - Word MVP

It does not really sound like and application for mailmerge. Maybe the
information in the following article will help

"Access a database and insert into a Word document the data that you find
there" at:

http://www.word.mvps.org/FAQs/InterDev/GetDataFromDB.htm


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
C

Claus

Thanks Doug,
I guess what I was really asking can Word use information from an HTML page
as source data for a mail merge.

If that is not possible, is it then possible for Word to run an Excel query
upon opening and then use the results from that query as the source for the
mail merge (without the user seeing the excel execution).

I know I can do an Excel query, because I have several application doing
that. I also have several web applications that query the database then
create a .txt file which the user is then prompted to download. These .txt
files are then used as the source data for the mailmerge. The user has to
download the file to a specific location on the their C: drive so the Word
template knows the data is there. Also, subsequent queries have to overwrite
the previous file with the new information. That leads to a couple of
obvious problems ie: the user downloads to an incorrect location and if it is
the first time the Word template crashes or worse if it not the first time,
the previous query is merged and user may not notice.

My quest is to eliminate the middle man so to speak. By opening the Word
document with a query on the database. Retrieve the correct data and
complete the merge. Keep in mind this is not a public web site, it simply
used so our varied office locations can use their web browsers to access the
data. So we have simmply moved our database applications to the web.

I know I can specify an URL in the file open dialouge box, because I have
done it. Now if that URL is a web application that queries the data base and
bring back a table with the record needed. Can that be used as a source for
a Mailmerge? And secondly can I add a parameter to that query? That's the
quest!

Claus
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top