Range.Scripts (Word)
Returns a Scripts collection that represents the collection of HTML scripts in the specified object.
Select Case Selection.Range.Scripts(2).Language
Case msoScriptLanguageASP
MsgBox "Active Server Pages"
Case msoScriptLanguageVisualBasic
MsgBox "VBScript"
Case msoScriptLanguageJava
MsgBox "JavaScript"
Case msoScriptLanguageOther
MsgBox "Unknown type of script"
End Select