Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can you trap "Word cannot find its data source" ??

Status
Not open for further replies.

SJG0526

Programmer
Jul 5, 2002
108
US
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top