Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize

Range.Scripts Property (Word)

Returns a Scripts collection that represents the collection of HTML scripts in the specified object.

expression .Scripts

expression Required. A variable that represents a Range object.

This example tests the second Script object in the specified range to determine its language.

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


Other resources

© 2015 Microsoft