
mail-merge MS Word and MS Access via ASP
hi,
i have a MS access 2000 database and MS word mailing label doc.
i wish to call the printing of the doc using asp.
the sql for the records will specified in the asp.
i read and modify the code from the following article
<How to Use Automation to Run Word 97 Mail Merge from Access>.
<%
strSQL = "SELECT uName, uAddr FROM user WHERE uRegion='Asia'"
Dim objWord
Set objWord = GetObject("Merge.doc", "Word.Document")
objWord.Application.Visible = True
objWord.MailMerge.OpenDataSource "sample.mdb", , , ,,,,,,,,,strSQL
objWord.MailMerge.Destination = wdSendToNewDocument
objWord.MailMerge.Execute
objWord.Application.Options.PrintBackground = False
objWord.Application.ActiveDocument.PrintOut
%>
but get the error 'word cannot open data source'.
i have already tried some other longer examples discussed but get the same err.
can anyone shed some light?
or better still, sample codes of how to do it.
thanks in advance.
<the more u know, the more u forget. the more u forget, the less u know.>
<the less u know, the less u forget. the less u forget, the more u know.>