Bypass Errors

The try-catch block, which is borrowed from Java, is used to bypass errors.

General syntax for a try-catch block:

try
{do something}
catch(errorname)
{do something with the error}
finally
{do something else}

Example of a try-catch block:

QPath = ActiveDocument.Sections["Query"].Limits
try
{QPath.Activate()}
catch(e)
{Alert(e.toString())}
finally
{Alert("We're Done!")}

The try-catch block does not usually identify definition errors but does identify errors such as use of a lowercase d in date():

try
{Alert(new date())}
catch(e)
{Alert(e.toString())}
finally
{Alert("We're Done!")}