You can find an quick sample that automates Word from VB to do a mail merge
at the following link.
220607 HOWTO: Automate Microsoft Word to Perform Mail Merge from Visual
Basic
http://support.microsoft.com/?id=220607
I would look closely at the CreateMailMergeDataFile Sub in the sample in
this KB Article. If you're sending a data file to the client, you can have
them read that data in and create the DataDocument on their side by reading
the data file you send them from the WEB Server. In that situation you'll
be modifying the CreateMailMergeDataFile SUB.
From what you wrote in the last thread, I believe the client is running the
mail merge from their PC, and that you send them the data they enter or
modify in a file that they download from the WEB Server. I also understand
that you are sending them a template Word MailMerge Document in the same
way. But it sounds like you are creating the Word MailMerge document on
the server side. If you are, you don't want to do this. If you need to
generate the MailMerge Document you want to do that on the client side as
well. KB Article 257757 goes into some of the details of why you would not
want to automate word from the server side. Here's a link to that article.
257757 INFO: Considerations for Server-Side Automation of Office
http://support.microsoft.com/?id=257757
If you have no choice and have to create the document on the server side
you may want to create an RTF File and do the MailMerge there. Then you
could have the client download the RTR File, which they would open in Word.
Here's a quick sample of how to create an RTF File using an ASP Page.
270906 HOWTO: Use ASP to Generate a Rich Text Format (RTF) Document to
Stream
http://support.microsoft.com/?id=270906
Let me know if this does the trick.
Stephen Culhane
(e-mail address removed)
Microsoft Developer Support
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
| Thread-Topic: Mail Merge Automation
| thread-index: AcP1/QzmsOd5GjLXRP2THmV/LIMzMg==
| X-Tomcat-NG: microsoft.public.office.developer.automation
| From: "=?Utf-8?B?Q2hyaXMgSG9hcmU=?=" <
[email protected]>
| Subject: Mail Merge Automation
| Date: Wed, 18 Feb 2004 00:56:08 -0800
| Lines: 12
| Message-ID: <
[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.office.developer.automation
| Path: cpmsftngxa07.phx.gbl
| Xref: cpmsftngxa07.phx.gbl
microsoft.public.office.developer.automation:8427
| NNTP-Posting-Host: tk2msftcmty1.phx.gbl 10.40.1.180
| X-Tomcat-NG: microsoft.public.office.developer.automation
|
| I need to do a mail merge letter for a generated contract. The letter
basically comes in two parts :
1 ) Standard letter bits - dear so and so
2 ) n Lines of contract specific information
The data is being supplied over the web and needs to be fairly simple for
the end user to understand (as they will want to be able to modify the
contracts without calling me for XSLT changes ...)
At the moment i output a table to disk; using word active x on teh client
pc, and then import that to a template which is downloaded from the
webserver. I am open to any suggestions because i am fresh out of ideas how
to accomplish this now... (Have tried two documents and an ole embed which
is force updated on merge xslt and a second merge to the file.)
The ole merge seemed to be a good idea; but in practice gave me issues
|