View Single Post
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default MailMerge hangs and crashes with Access on Server

Which version of Word/Access is this? If it is 2007, there have
definitely been reports of inconsistent responses, and I do not know the
reason.

Can you verify that Access is not displaying any dialog boxes that need
a response (e.g. use Alt-tab to look around) ?

I do not think it will work but, as an experiment, could you try
omitting the Connection:="QUERY qryForReport" parameter?

Peter Jamieson

http://tips.pjmsn.me.uk
Visit Londinium at http://www.ralphwatson.tv

4charity wrote:
I have successfully created an Access database that launches Word MailMerge
letters/catalogs, and populates the templates nicely, when the database is
installed on my harddrive (with templates on the server.) (It is actually a
series of 2 functions, which executes the merging of 2 different Mailmerges -
one letter, and then one email on the click of one button.)

I have now moved the database to the server, and word is launched, the
template opened, but then when it attempts to populate the fields, Word just
hangs and hangs, and eventually becomes nonresponsive. It did actually work
one time, merging the first letter, but hanging on the opening of the second
template. I know that the server is very slow, but is there anything I should
look for to try and make this work? I am posting my code he

Function MergeItInsuredOne()


Dim objWord As Word.Document
Set objWord = GetObject("X:\LCMG\Access Work\DTULetters\Insured Letter
(Full) One Invoice.doc", "Word.Document")
' Make Word visible.
objWord.Application.Visible = True
' Set the mail merge data source as the DTD database.
objWord.MailMerge.OpenDataSource _
Name:="X:\LCMG\DTU\DTDBeta.mdb", _
LinkToSource:=True, _
Connection:="QUERY qryForReport", _
SQLStatement:="SELECT * FROM [qryForReport]WHERE ClaimNumber = '" &
Me.ClaimNumberforMerge.Column(1) & "'"

' Execute the mail merge.
objWord.MailMerge.Execute
'close the orginal file
objWord.Close wdDoNotSaveChanges
'close Access copy not necessary when in user access mode (Docmd.Quit)
MergeEmailInsuredFull
End Function
__________________________________________________ _____________
Function MergeEmailInsuredFull()
Dim objWord As Word.Document
Set objWord = GetObject("X:\LCMG\Access Work\DTULetters\EMail Insured
Full.doc", "Word.Document")
' Make Word visible.
objWord.Application.Visible = True
' Set the mail merge data source as the DTD database.
objWord.MailMerge.OpenDataSource _
Name:="X:\LCMG\DTU\DTDBeta.mdb", _
LinkToSource:=True, _
Connection:="QUERY qryForReport", _
SQLStatement:="SELECT * FROM [qryForReport]WHERE ClaimNumber = '" &
Me.ClaimNumberforMerge.Column(1) & "'"

' Execute the mail merge.
objWord.MailMerge.Execute
'close the orginal file
objWord.Close wdDoNotSaveChanges
'Lock Document
If ActiveDocument.ProtectionType = wdNoProtection Then
ActiveDocument.Protect Type:=wdAllowOnlyFormFields, _
NoReset:=True

End If
End Function