I have an Access database from which I would like to print a MailMerge. The code I am using runs on a click event from a form in Access. It launche Word, opens the template into which the data is merged, and sucessfully completes the merge. The problem comes when I attempt to print the merged...
Play with the macrorecorder when doing that.
I'm sorry, I don't understand what you are asking me to do. Should I just eliminate the code that doesn't seem to work and complete the merge and printing manually? Or are you suggesting a macro from within Access to complete the task?
Bob
PH,
Word 97 SR2
What happens when you double-click AccessSurgRpt.dot in an Explorer window ?
--It opens to the template without merging the data, as I would expect. It does this through the code also. It gets that far and then the error message comes up. If I try to complete the merge from...
Adapting some code I got here last week for another database (in which it is working well) I am having a problem opening an Access database to do a mailmerge in Word. The database that can't be open is the one that is calling the mail merge. Here is the code with the porblem area in red...
PH and Paul,
The code that is presently working and doing very well is:
Public Function MergeIt1()
Dim odoc As Word.Document, objWord As Object
Set objWord = CreateObject("Word.Application")
objWord.Visible = True
Set odoc = objWord.Documents.Add("C:\Program Files\Microsoft Office\Templates\Lyme...
Paul,
I really thank you for the time you have put into assisting me in this bit of code.
In the Reference library I find 3 Microsoft ActiveX Data Objects 2.x Libraries. The program will only allow 1 of those to be checked at a time or it will yield a naming conflict error. They are 2.1...
I am getting an error "ActiveX component can't create object"
Public Function MergeIt()
Dim odoc As Word.Document
Set odoc = GetObject("C:\Program Files\Microsoft Office\Templates\LymePositive.dot", "Word Document")
odoc.MailMerge.OpenDataSource _
Name:="C:\My...
Paul,
I get an error with the Dim statement: "User defined type not defined".
Public Function MergeIt()
Dim odoc As Word.Document
Set odoc = GetObject("PathtoyourFormLetter", "Word Document")
odoc.MailMerge.OpenDataSource _
Name:="PathTo.mdbFile", _
linktosource: = True, _
connection:="QUERY...
I have never used the Shell function before, so I am not certain just how to get done what I need. I need to open Word from Access, then open a form letter template that gets its data from the Access database from which I am opening Word. Then merge the data and print the letters. I can open...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.