Lushous
asked on
VB 6/ Mail Merge/Access Database
Hi all,
I have an access database with a list of client names. I have a VB program that i want to interface with a word doc to access a particular file and then mail merge with the names in the database.
I am using the code below to open the word doc from VB but how do i then get to merge the data from the database into the word doc??
Private Sub cmdCreateNewsletter_Click( )
Dim objWord As Word.Application
Set objWord = New Word.Application
With objWord
.Visible = True
.Documents.Open App.Path & "\news.doc"
.Selection.InsertAfter ""
.Quit True
End With
Set objWord = Nothing
End Sub
I was thinking I need to insert some more code somewhere?
Any ideas?
I have an access database with a list of client names. I have a VB program that i want to interface with a word doc to access a particular file and then mail merge with the names in the database.
I am using the code below to open the word doc from VB but how do i then get to merge the data from the database into the word doc??
Private Sub cmdCreateNewsletter_Click(
Dim objWord As Word.Application
Set objWord = New Word.Application
With objWord
.Visible = True
.Documents.Open App.Path & "\news.doc"
.Selection.InsertAfter ""
.Quit True
End With
Set objWord = Nothing
End Sub
I was thinking I need to insert some more code somewhere?
Any ideas?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanxs my fellow collegues
http://www.planet-source-code.com/xq/ASP/txtCodeId.1038/lngWId.1/qx/vb/scripts/ShowCode.htm
http://www.mvps.org/access/bugs/bugs0011.htm
http://www.tfwpa.com/msaccess/wordmerge.htm
'Hope will help.