Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple Mail Merge

Status
Not open for further replies.

bobmunkhouse

Technical User
Feb 23, 2003
14
US
Hey everyone

I need a macro to start the "Merge It with MS Word" wizard using my table "tblTeam"

Can this be done?

Thanks in advance
 
I don't know any macro that will do it but you can put this function in a module changing the appropriate paths and connections and then call it from a macro.

Public Function MergeIt()
Dim oDoc As Word.Document
Set oDoc = GetObject("C:\My Stuff\Wildcat Camper Letter 2001.doc", "Word.Document")
'oDoc.Application.Visible = True
oDoc.MailMerge.OpenDataSource _
Name:="c:\My Documents\summerprograms2000.mdb", _
linktosource:=True, _
Connection:="QUERY qryMailMergeInformation", _
SQLStatement:="Select * From [qryMailMergeInformation]"
oDoc.MailMerge.Execute
'oDoc.Application.Options.PrintBackground = False
oDoc.Application.ActiveDocument.PrintOut
End Function

Paul
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top