Here is a very quick example of a MM baced on an existing MM template document.
VB Code:
Option Explicit 'Add reference to MS Word xx.0 Object Library Private moApp As Word.Application Private Sub Command1_Click() Dim oDoc As Word.Document moApp.Visible = True Set oDoc = moApp.Documents.Add("D:\Test.dot", , , True) With oDoc.MailMerge .MainDocumentType = wdFormLetters .OpenDataSource Name:="D:\RobDog888.mdb", LinkToSource:=True, Connection:="TABLE ClientData" End With With oDoc.MailMerge.DataSource .FirstRecord = 1 .LastRecord = 20 End With With oDoc.MailMerge .Destination = wdSendToPrinter 'wdSendToNewDocument; wdSendToFax; wdSendToEmail .Execute True End With End Sub Private Sub Form_Load() Set moApp = New Word.Application End Sub





Reply With Quote