Probably, the template is still a Word6 document. It needs to be permanently converted, which means you will need to actually go through the code line by line to make it compliant with VBA.
Probably, the template is still a Word6 document. It needs to be permanently converted, which means you will need to actually go through the code line by line to make it compliant with VBA.

This month, every Windows Secrets subscriber can download a one-chapter excerpt of Windows 7: The Missing Manual.Windows 7: The Missing Manual provides valuable information to help you overcome these difficulties in learning a new operating system. Subscribe today to download your free excerpt.
That's right. This is one of those beyond-my-control issues. I wish it weren't so. I'd like AT LEAST to be able to trap the condition, log an error report, and continue processing files.
When Word97SR2 attempts to open a template that has a WordBasic syntax error, it issues a pop-up message box that reads:"Some macros in this template will not run properly in Word" etc.
An attempt to trap this with an On Error statement fails. I seem to recall that most if not all of the 3rd-party converters used by MSWord cause the same sort of problems.
If anyone has a solution, I'd be pleased to hear it.
I'm in the business of opening templates in unattended mode, and it bugs the heck out of me to return to the machine and find one of these things waiting for me these past five hours.
FWIW the offending code appears below. Once I click on "OK" the converter appears to embrace the faulty keyword in double-quotes and get on with its life.
<pre>WordBasic.EditReplace Find := " ", ReplaceAll := " ", Direction := 0,_
"matcase" := 0, WholeWord := 0, patternmatch = 0, Wrap := 0
^^^^^^^^^
matchcase
</pre>
My code to open this particular template looks like this:
[pre]
Sub test()
On Error GoTo cantopen
Documents.Open FileName:="h:templates9980520.dot", ReadOnly:=True,_
ConfirmConversions:=False
GoTo canopen
cantopen:
MsgBox "failed to open"
canopen:
End Sub
[/pre