I loop through the doc files in a folder. Some of them are mailmerge docs that have lost their data sources. Is there any way to trap for this error? I tried:
On Error Resume Next
Documents.Open FileName:=sDoc, ReadOnly:=True, PasswordDocument:="", _
PasswordTemplate:="", Revert:=False, WritePasswordDocument:="", _
WritePasswordTemplate:="", Format:=wdOpenFormatAuto
MsgBox Err.Number
and suspended the code on the msgbox but I can't get by the message saying "... is a mail merge document. Word can not find its data source ...". If I have it go to an error routine instead of Resume next, I still get the error message before the error routine is executed. Any way to bypass this error message?? It requires user input which I can't allow.
On Error Resume Next
Documents.Open FileName:=sDoc, ReadOnly:=True, PasswordDocument:="", _
PasswordTemplate:="", Revert:=False, WritePasswordDocument:="", _
WritePasswordTemplate:="", Format:=wdOpenFormatAuto
MsgBox Err.Number
and suspended the code on the msgbox but I can't get by the message saying "... is a mail merge document. Word can not find its data source ...". If I have it go to an error routine instead of Resume next, I still get the error message before the error routine is executed. Any way to bypass this error message?? It requires user input which I can't allow.