Yes, you can use JavaScript. You need to add a reference to the Microsoft Script Control. Generally this is used to run VBScript modules, but it actually supports any scripting language that thew Windows Scripting Host supports - and one of those is, of course, JavaScript. To set it up is a s easy as:
[tt]
Dim wsh As ScriptControl
Set wsh = New ScriptControl
wsh.Language = "Jscript" ' Choose your scripting language
[/tt]
After that you're on your own. I suggest you check out the script control documentation.