|
Microsoft released Visual Studio for Applications (VSA) SDK Beta 2.
Download the SDK from http://www.msdn.microsoft.com/scripting.
"VSA provides a fully integrated way for customers to seamlessly customize and extend the functionality of Web-based applications using familiar tools."
claims Microsoft. What is VSA? It's the .net version of VBA, Visual Basic for Applications, which is used to write Macros and Extensions for Outlook, Word and Excel etc.
You provide the application code, your customer can extend it using scripts.
The following code example shows how to run VB Script or JavaScript inside your
.net application.
1) Instantiate the Script Engine.
2) Pass objects to be used by the script to the engine.
3) Add your script to the engine.
4) Compile the script.
5) Get a handle to the objects in the script
6) Get a handle to the method you like to call.
7) Invoke the method.
First compile the VsaArticleEngine.MyEngine into a .dll.
Don't forget to change Line 38 to the path on your machine.
Create a ConsoleApplication for VsaArticle.TestVsa
and run it.
There are two essential articles written by Microsoft's
script guru Andrew Clinick which can be found at:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnclinic/html/scripting091399.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnclinic/html/scripting091399.asp
Enjoy and don't give up, when it doesn't run first time!
|