Link to home
Start Free TrialLog in
Avatar of Lushous
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?
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

Hi, i also work with word mail merge these day and hope the following links with help you a litte:

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.
ASKER CERTIFIED SOLUTION
Avatar of cquinn
cquinn
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Lushous
Lushous

ASKER

thanxs my fellow collegues