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

running mail merge with access

Status
Not open for further replies.

rdkirb49

Technical User
Jun 24, 2004
33
US
I know how to do the office link thingy, but if I wanted to run a mail merge document using a query and a switchboard button? It is my next source of frustration.. Please help..........
 
If you're actually using the switchboard, you're out of luck. The closest you can get to this is to have the switchboard open up a form that can THEN take you to the mailmerge document.

By far the easiest way to open up the mailmerge document is to use in VBA code:

[tt]Shell "N:\full\path\filename.DOC"[/tt]

And that opens your mailmerge document.

Alternately, I have written a FAQ about using mailmerge from Access, but you'd have to be very comfortable with VBA code to use it:

'Native' mailmerge reports - as painless as possible faq181-5088

--
Find common answers using Google Groups:

Corrupt MDBs FAQ
 
So I use this code in my whitchboard?
rivate Sub Option3_Click()
'Function MergeIt()
Dim objWord As Word.Document
Set objWord = GetObject("D:\archive\DUMMY_1040MFS.doc", "Word.Document")
' Make Word visible.
objWord.Application.Visible = True
' Set the mail merge data source as CorrBatch4Pasted.
objWord.MailMerge.OpenDataSource _
Name:="D:\archive " & _
"National Archive.mdb", _
LinkToSource:=True, _
Connection:="TABLE CorrBatch4Pasted", _
SQLStatement:="SELECT * FROM [Forms]![Batch 4 stat query]![Combo2]"
' Execute the mail merge.
objWord.MailMerge.Execute
'End Function

End Sub
This is the code I have been trying to use. But when I have my switchboard open at startup my references are lost.
 
I use your shell and I got the error message compile error: invalid outside procedure.

Shell "D:\archive\DUMMY_1040MFS.DOC"

The file is on my D: drive in my archive folder .

HELP!!!!!!!!!!!
 
Ok, then try

Shell "start D:\archive\DUMMY_1040MFS.DOC"

my bad for providing a bad example.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top