Suggestions need for best way to Mail Merge

Zenobia

Registered User.
Local time
Today, 03:56
Joined
Jan 28, 2011
Messages
35
Hello,
I wish to create a button on a form that will link to data in a table and create mail merge, or link to an existing mail merge document, what is the best way to do this?

Thank you
 
check out supereasy word merge - in the samples
 
Great thank you. Is there anything else i need to do but insert this code

Option Compare Database

Dim WithEvents oApp As Word.Application

Private Sub Command0_Click()

Dim oMainDoc As Word.Document
Dim oSel As Word.Selection
Dim sDBPath As String

Set oMainDoc = oApp.Documents.Open("c:\Test Letter")
oApp.Visible = True

With oMainDoc.MailMerge

.MainDocumentType = wdFormLetters

sDBPath = "C:\Letter Database.mdb"
.OpenDataSource Name:=sDBPath, _
SQLStatement:="SELECT * FROM [tblcompanies]"

End With

With oMainDoc
.MailMerge.Destination = wdSendToNewDocument
.MailMerge.Execute
End With

oApp.Activate
oApp.Documents.Parent.Visible = True
oApp.Application.WindowState = 1
oApp.ActiveWindow.WindowState = 1

End Sub

Private Sub Form_Load()

Set oApp = CreateObject("Word.Application")

End Sub

Private Sub Form_Unload(Cancel As Integer)

Set oApp = Nothing

End Sub

as not working for me just inserting this code...

Any anyone shed any light on this for me please?
 

Users who are viewing this thread

Back
Top Bottom