title: How can we programmatically know the syntax error using msscript.ocx?
body: <p>I have implemented msscript.ocx using c# and it works for VBScript.</p>
  
  <p>Consider the following VBScript code:</p>
  
  <pre><code>For i = 0 To 5
  
    'The following line has missing 'Then'. It should show an error.
    If i = 2
      Exit For
    End If
  
  Next
  </code></pre>
  
  <p>How can we tell if there is an error in line containing <code>If</code> (missing <code>Then</code>) without running the script?</p>