ASP/Word Merge

J

JV

I've done some research on how to do a MS Word merge with data I read
in an ASP application (using a SQL Server database).

I understand the concept since I've done it in a couple other
programming languages. However, I need to pointers/help how to do this
in ASP.

Thanks very much for your help!

JV
 
R

Ray Costanzo [MVP]

Hi JV,

ASP is really not the right technology to use for automating mail merges in
Word. For one, server-side automation of Office objects (i.e. Word) is
strongly ill-advised. Also, ASP is meant for immediate request and response
type of interaction between a user and a server, not long job processing.
May I ask why you need to do this in ASP as opposed to just running a vbs
script or something along those lines to do this?

Ray at work
 
J

JV

Ray,

A VBS script would be fine too (it's just an ASP environment ...). What
do I need to do to set this up in VBS script? Where would I call this
script? Perhaps you have an example .... ?

JV
 
R

Ray Costanzo [MVP]

I do not have an example or anything. Most of this would involve automation
of Word and being familiar with the Word object model. I suggest inquiring
in a Word programming group (VBA) and starting there. If you can get it
working in VBA in Word, it should be translatable to VBS. For help with
that, I'd then go to m.p.scripting.vbscript.

Ray at work
 
J

JV

Fair enough.

I assume this option (VBs) requires MS Word to be installed on the
server? I'd like to create a document (by means of the merge) and let
the user download it to his/her client.

JV
 
J

JV

Perhaps I should ask a somewhat different question instead. Is it
possible to have merge data (from SQL Server) via special placeholders
in a Word document ? I noticed that most "Word merge VBs examples" all
create new documents by inserting things like paragrahs in conjunction
to actual data. I'd like to define my template first and then just
replace its placeholders with actual data.
 
R

Ray Costanzo [MVP]

Yes, it's all possible, but you need to start small and do it one step at a
time.

1. How do you connect to a SQL Server?
2. How do you get data from it and put the data into a string variable?
3. How do you open up a Word doc programatically?
4. How do you insert string data from a string variable into a Word doc
programatically?

One step at a time. Ask appropriate questions in appropriate groups.

Ray at work
 

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

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top