How do I merge access data with Word using 2003?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm using Outlook 2003 and Word 2003. I want to be able to click on a button
on a form with my data on it and a merge starts and it merges the data on my
form with a word document that's already set up for merging.

I don't know the code for the button when you click on it.

Thank you.
 
Create A word document, insert book marks where you want the value from
access should be displayed, and then run this code

Public Sub PrintToWord()
Dim wd As Word.Application
Dim myDoc As Word.Document

Set wd = New Word.Application
wd.Documents.Add DOTpath & reportName & ".dot" ' The name and path
Set myDoc = wd.ActiveDocument
With wd.Selection
.GoTo wdGoToBookmark, Name:=BookMarkName ' The name of the book
mark
.Font.Bold = True ' You can choose if bold
.Font.Underline = False ' or underline
.TypeText Text:=ValueToInsertInTheBookMark ' insert values
End With
wd.Visible = True

End Sub

You need to create reference to Microsoft Word.
 
Back
Top