H
Hermann Schaffer
Ich want to change the datasource of a mailmerge documente from vb-code
(from an Access-application). Made the following coding:
Dim wrd As New Word.Application
wrd.Documents.Open "c:\scratch\My.doc"
wrd.ActiveDocument.MailMerge.OpenDataSource
Name:="c:\infar\MynewDS.mdb", _
LinkToSource:=True, Connection:="TABLE mytab"
wrd.ActiveDocument.Save
wrd.ActiveDocument.Close
wrd.Quit
Set wrd = Nothing
Problem: the DataSource-apllication (the access-db) stays open after the
quit-statement.
Qu1: is there a better way to change the dataSource? (or)
Qu2: how do I make sure the access-db will be closed?
- hermann -
(from an Access-application). Made the following coding:
Dim wrd As New Word.Application
wrd.Documents.Open "c:\scratch\My.doc"
wrd.ActiveDocument.MailMerge.OpenDataSource
Name:="c:\infar\MynewDS.mdb", _
LinkToSource:=True, Connection:="TABLE mytab"
wrd.ActiveDocument.Save
wrd.ActiveDocument.Close
wrd.Quit
Set wrd = Nothing
Problem: the DataSource-apllication (the access-db) stays open after the
quit-statement.
Qu1: is there a better way to change the dataSource? (or)
Qu2: how do I make sure the access-db will be closed?
- hermann -