I am having a problem concerning the following code:
Dim strFileName As String
Dim wrdDoc As Object
Dim objWD As Object
Dim strSQL As String
strSQl = "c:\My Documents\Letters\TestLetter.doc"
Set objWD = CreateObject("Word.Application"
Set wrdDoc = objWD.Documents.Open(strFileName)
objWD.ActiveDocument.MailMerge.Execute
objWD.ActiveDocument.PrintOut Background:=False
objWD.ActiveDocument.Close SaveChanges:=wdDoNotSaveChanges
objWD.Quit
Any time there is an error during execution this leaves a copy of winword in memory, which can result in multiple copies of winword lost in memory. Adding objWD.Quit to the error traping routine only results in and endless loop.
Any Help ????
Dim strFileName As String
Dim wrdDoc As Object
Dim objWD As Object
Dim strSQL As String
strSQl = "c:\My Documents\Letters\TestLetter.doc"
Set objWD = CreateObject("Word.Application"
Set wrdDoc = objWD.Documents.Open(strFileName)
objWD.ActiveDocument.MailMerge.Execute
objWD.ActiveDocument.PrintOut Background:=False
objWD.ActiveDocument.Close SaveChanges:=wdDoNotSaveChanges
objWD.Quit
Any time there is an error during execution this leaves a copy of winword in memory, which can result in multiple copies of winword lost in memory. Adding objWD.Quit to the error traping routine only results in and endless loop.
Any Help ????