View Single Post
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Don
 
Posts: n/a
Default .ActiveDocument.mailmerge Syntax sometimes not working

Hello, I'm using this code below from with Access to open a Word document.
It works fine on my machine but I have a user that gets an error when trying
to run the mailmerge.execute line. Any thought why?

Dim objApp As Object
Dim strDocName As String
Dim strDocNameB As String
'strDocName = rs!ClosingDir & "\MasterTest.doc"
strDocName = rs!ClosingDir & "\" & rs!ClosingDoc
Set objApp = CreateObject("Word.application")
With objApp
.Visible = True
.Documents.Open strDocName
strDocNameB = objApp.ActiveDocument.Name
***Lines Below sometimes don't work on other machines.
.ActiveDocument.mailmerge.Destination = 0 'wdSendToNewDocument
.ActiveDocument.mailmerge.Execute
.Documents(strDocNameB).Close 0
End With