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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mail merge and word

Status
Not open for further replies.

skate

Technical User
Nov 29, 2002
65
CA
I have two questions. Here is my code for making mailing labels
Function MergeIt()
Dim MailOutDoc As Word.Document
Set MailOutDoc = GetObject("J:\Office.sys\AHLS_Database\AHLS_Database_Mailing_Labels.doc", "Word.Document")
MailOutDoc.Application.Visible = True
MailOutDoc.MailMerge.OpenDataSource _
Name:="J:\Office.sys\AHLS_Database\AHLS_Database.mdb", _
LinkToSource:=True, _
Connection:="QUERY Mail List Customer Contact Query", _
SQLStatement:="Select * from [Mail List Customer Contact Query]"
MailOutDoc.MailMerge.Destination = wdSendToNewDocument
MailOutDoc.MailMerge.Execute
MailOutDoc.Application.Options.PrintBackground = False
MailOutDoc.Application.ActiveDocument.PrintOut
End Function

However, when I click on the button in access that executes this function, my word doc opens, a new word doc opens and two more databases open. I don't really understand the coding well, so if someone could help...
I just want the one word doc w/ the mailing labels to open (it can be a new doc).

Secondly, if someone already has a letter they have written up and wants to use the db to merge with their letter, how could this be done? It obviously must be specific to their document name.

Thanks in advance
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top