I have Googled this extensively and see that lots of people are having the same problem.

I am trying to call a Word macro that runs a mail merge (The data source is in Access) from Excel to save my users a bunch of confusing steps and am getting the following error:

Run-time error '4605':

This method or property is not available because the document is not a mail merge main document.



Excel macro:

Sub runwordmacro()

Set WD = CreateObject("word.application")

WD.Application.documents.Open "K:\Software\Dynamics\Automate JEs\Automatic Journal Entry Import.docm"
WD.Application.Visible = True
WD.Application****n "PayrollJE"
Set WD = Nothing

End Sub

Word macro:

Sub PayrollJE()
'
' PayrollJE Macro
'
'' Open the Mail Merge Template and execute the Mail Merge.
Dim objWord As Word.Document
Set objWord = GetObject("K:\Software\Dynamics\Automate JEs\JE Import Mail Merge Template - Payroll.doc", "Word.Document")
' Make Word visible.
objWord.Application.Visible = True
Application.DisplayAlerts = wdAlertsNone
SubType = wdMergeSubTypeWord2000
'
' Execute the mail merge.
objWord.MailMerge.Execute
'
'Insert Header and Footer
'
Selection.TypeText Text:="# DEXVERSION=10.0.320.0 2 2"
Selection.TypeParagraph
Selection.TypeText Text:= _
" CommandExec dictionary 'default' form 'Command_Financial' command 'GL_Transaction_Entry'"
Selection.TypeParagraph
Selection.TypeText Text:= _
"NewActiveWin dictionary 'default' form 'GL_Transaction_Entry' window 'GL_Transaction_Entry'"
Selection.TypeParagraph
Selection.TypeText Text:= _
"WindowMove dictionary 'default' form 'GL_Transaction_Entry' window 'GL_Transaction_Entry' pointh 283 pointv -137"
Selection.TypeParagraph
Selection.TypeText Text:= _
"WindowSize dictionary 'default' form 'GL_Transaction_Entry' window 'GL_Transaction_Entry' pointh 562 pointv 979"
Selection.TypeParagraph
Selection.EndKey Unit:=wdStory
Selection.TypeText Text:= _
"ActivateWindow dictionary 'default' form sheLL window sheLL"
Selection.TypeParagraph
'
'Save the merged documant as a Plain Text file with a .mac extensionWord document
'
ChangeFileOpenDirectory "K:\Software\Dynamics\Automate JEs\"
ActiveDocument.SaveAs FileName:= _
"K:\Software\Dynamics\Automate JEs\ImportJE.mac", FileFormat:= _
wdFormatText, LockComments:=False, Password:="", AddToRecentFiles:=True, _
WritePassword:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:=False, _
SaveNativePictureFormat:=False, SaveFormsData:=False, SaveAsAOCELetter:= _
False, Encoding:=1252, InsertLineBreaks:=False, AllowSubstitutions:=False _
, LineEnding:=wdCRLF
ActiveDocument.Close
'
'Close Mail Merge document
Windows("JE Import Mail Merge Template - Payroll.doc [Compatibility Mode]").Activate
ActiveDocument.Close
'
End Sub

Sub PayrollBatches()
'
' PayrollBatches Macro
'
' Open the Mail Merge Template and execute the Mail Merge.
Dim objWord As Word.Document
Set objWord = GetObject("K:\Software\Dynamics\Automate JEs\JE Import Mail Merge Template - Batches.doc", "Word.Document")
' Make Word visible.
objWord.Application.Visible = True
Application.DisplayAlerts = wdAlertsNone
SubType = wdMergeSubTypeWord2000
'
' Execute the mail merge.
objWord.MailMerge.Execute
'
'Insert Header and Footer
'
Selection.TypeText Text:="# DEXVERSION=10.0.320.0 2 2"
Selection.TypeParagraph
Selection.TypeText Text:= _
" CommandExec dictionary 'default' form 'Command_Financial' command 'GL_Transaction_Entry'"
Selection.TypeParagraph
Selection.TypeText Text:= _
"NewActiveWin dictionary 'default' form 'GL_Transaction_Entry' window 'GL_Transaction_Entry'"
Selection.TypeParagraph
Selection.TypeText Text:= _
"WindowMove dictionary 'default' form 'GL_Transaction_Entry' window 'GL_Transaction_Entry' pointh 283 pointv -137"
Selection.TypeParagraph
Selection.TypeText Text:= _
"WindowSize dictionary 'default' form 'GL_Transaction_Entry' window 'GL_Transaction_Entry' pointh 562 pointv 979"
Selection.TypeParagraph
Selection.EndKey Unit:=wdStory
Selection.TypeText Text:= _
"ActivateWindow dictionary 'default' form sheLL window sheLL"
Selection.TypeParagraph
'
'Save the merged documant as a Plain Text file with a .mac extensionWord document
'
ChangeFileOpenDirectory "K:\Software\Dynamics\Automate JEs\"
ActiveDocument.SaveAs FileName:= _
"K:\Software\Dynamics\Automate JEs\ImportJE.mac", FileFormat:= _
wdFormatText, LockComments:=False, Password:="", AddToRecentFiles:=True, _
WritePassword:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:=False, _
SaveNativePictureFormat:=False, SaveFormsData:=False, SaveAsAOCELetter:= _
False, Encoding:=1252, InsertLineBreaks:=False, AllowSubstitutions:=False _
, LineEnding:=wdCRLF
ActiveDocument.Close
'
'Close Mail Merge document
Windows("JE Import Mail Merge Template - Batches.doc [Compatibility Mode]").Activate
ActiveDocument.Close
'
End Sub


The one thing I see that I think could be the problem is that when the mail merge template opens it says it is in Compatibility Mode. Is there a way to turn that off?