mail-merge MS Word and MS Access via ASP 
Author Message
 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.>



Fri, 14 Nov 2003 13:31:28 GMT  
 mail-merge MS Word and MS Access via ASP

Quote:
> 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

> but get the error 'word cannot open data source'.

Use full path. I doubt Word's current directory is the same as yours.

Jenda



Fri, 14 Nov 2003 16:41:26 GMT  
 mail-merge MS Word and MS Access via ASP

Quote:

> Use full path. I doubt Word's current directory is the same as yours.

> Jenda

i already tried the full path but still got the same error.
does it have anything to do with drivers or newer version files...?

aaronkwk



Sun, 16 Nov 2003 10:27:07 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Word Mail merge field TO MS Access???

2. Mail Merge: MS-Word/Access

3. mail merge coding with MS access in word

4. From VB6, call a MS WORD Mail-Merge feature

5. VB to MS Word Mail merge functionallity

6. Mail merge to Ms Word

7. MS Word 97 Mail Merge with Oracle Datasource?

8. SLOW MS Word Mail Merge with VB5

9. Mail Merge in MS Word?

10. MS-Word mail merge

11. OLE Control and MS Word Mail Merge

12. MS Word 97 Mail Merge with Oracle Datasource?

 

 
Powered by phpBB® Forum Software