There is a "scripts" object/collection available under the Document object (which in your code var1 has a handle to), so this may be the place to look.[for the picture of Object model
Click Here (Microsoft MSDN site).
If you have Office XP, the htmlref.chm help file is supposed to document all this - I don't have Office XP, so don't have that file on my system.
Once you have right script object from the scripts collection, I'd be surprised if you cannot call the functions in that script externally using a method sun run or execute etc - but the script object would have to expose such a method.