This is the code you first sent to me in response to my initial query
[code]
Sub DavidCoupe()
'DavidCoupe Macro
'
Call OpenDoc("E:\DOCUMENTS\COUPE\D_C.dotm")
Selection.MoveDown Unit:=wdLine, Count:=6
End Sub
Sub HDDJtPaper()
' HDDJtPaper Macro
Call OpenDoc("E:\DOCUMENTS\HDDjt.docx")
Selection.MoveDown Unit:=wdLine, Count:=8
End Sub
Sub QUESTA()
' QUESTA Macro
'
Call OpenDoc("E:\DOCUMENTS\QUESTA\CHRIS.doc")
Selection.MoveDown Unit:=wdLine, Count:=7
End Sub
Sub HDDR()
' HDDR Macro
'
Call OpenDoc("E:\DOCUMENTS\HDDRpaper.docx")
End Sub
Sub OpenDoc(StrDoc As String)
Documents.Open FileName:="StrDoc", ConfirmConversions:=False, ReadOnly:= _
False, AddToRecentFiles:=False, PasswordDocument:="", PasswordTemplate:= _
"", Revert:=False, WritePasswordDocument:="", WritePasswordTemplate:="", _
Format:=wdOpenFormatAuto, XMLTransform:=""
Applying the same principle to the code for Macro MMM it reads as below
(with 2 OpenDoc references)
Code:
Sub MMM()
'
' MMM Macro
'
'Call OpenDoc("E:\DOCUMENTS\MMM\LETTER.doC")
Selection.MoveDown Unit:=wdLine, Count:=6
End Sub
Sub OpenDoc(StrDoc As String)
Documents.Open FileName:="StrDoc", ConfirmConversions:=False, ReadOnly:= _
False, AddToRecentFiles:=False, PasswordDocument:="", PasswordTemplate:= _
"", Revert:=False, WritePasswordDocument:="", WritePasswordTemplate:="", _
Format:=wdOpenFormatAuto, XMLTransform:=""
I get the error code which you say is due to two
OpenDoc instructions
BUT
If I try to run the macro with only one
OpenDoc instruction
Code:
Sub MMM()
'
' MMM Macro
'
'Call OpenDoc("E:\DOCUMENTS\MMM\LETTER.doC")
Selection.MoveDown Unit:=wdLine, Count:=6
End Sub
Nothing happens ie the macro does not run
What am I doing wrong,please?