faqts : Computers : Programming

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

4 of 41 people (10%) answered Yes
Recently 1 of 10 people (10%) answered Yes

Entry

How to perform Ms word mail merge using ASP

Apr 27th, 2005 01:21
Keyar Srinivasan, Dorothy Rose,


One of the Possible way to obtain this is to use XML+XSL for this case. 
Instead of your DOT file you can use XSL (which will have formatting 
and transforming), and data can be in XML (maybe also coming from SQL 
in XML format). This is the best and you can acheive scalability also. 
If the client needs output in Word format, then you can use 
Response.ContentType 
Try something like this ... 
Dim m_WordServer As Word.ApplicationClass 
m_WordServer = New Word.Application() 
With m_WordServer 
'Open the word document 
.Documents.Open( _ 
FileName:=word_filename, _ 
ConfirmConversions:=False, _ 
ReadOnly:=True, _ 
AddToRecentFiles:=False, _ 
PasswordDocument:="", _ 
PasswordTemplate:="", _ 
Revert:=False, _ 
WritePasswordDocument:="", _ 
WritePasswordTemplate:="", _ 
Format:=Word.WdOpenFormat.wdOpenFormatAuto) 
....... 
m_WordServer.Quit() 
m_WordServer = Nothing