Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

For those of us who are used to static typing, this may seem like a dangerous practice.  I think you will find, though, that it works surprisingly well.  It also simplifies things considerably.  Have you seen the number of COM wrappers that Microsoft.NET has to support (for some, multiple versions of the same library)?  Scriptom doesn't require a COM wrapper generator (though it does include a library of constant definitions for some COM libraries).  You can just write your code and run it.  And it just works.

Scriptom uses the same calling mechanism that is used by Microsoft's typeless scripting languages, like VBScript and JScript.  It is also the calling convention that is used from Visual Basic 6 or VBA when you are working with an Object.  That is why they call it Scriptom.  It uses the calling convention that is normally used by scripting languages.

...

So if there is no IDE integration for Scriptom, how do you figure out the COM thing?  Here are some ideas, based on my own experience working with COM.  These aren't quite the same as having full IDE integration, like Java in Eclipse, but in my experience they do help you get the job done.

  • Use VB6 or VBA to browse the object models and write sample code. Visual Basic 6 and VBA have a nearly identical set of tools for browsing objects, setting references to COM libraries, and for look-ahead help.  Most COM libraries were designed to be compatible with Visual Basic, and those will usually work well with ScriptomVB6 is part of Visual Studio 6, which is scheduled to be desupported by Microsoft in 2008.  VBA is available as the macro language in all the Microsoft Office products, and in many other products as well.
    • Use Visual Studio.NET to browse the object model.  I don't recommend this over VB6/VBA because the support for COM is a little more obscure in the Microsoft.NET products.   However, in a pinch, it works, and the Visual Studio Express products are free.  
  • Buy a book.  There are many books available that cover COM APIs for specific products.  For example, a used copy of Excel 2002 VBA on Amazon would run you less the $15, including shipping.  When you are working with the really complex applications, like Excel and Word, I have always found it beneficial to have a second opinion.
  • Use the web to find examples.  Some people call it "Programming by Google."  If you want to do something, you can bet that some other fool has already done it and published it somewhere on the web.
  • Read the manual.  Use Microsoft's search tool at http://msdn.microsoft.com to find the official documentation.  Some of it is very good, some it will leave you with questions, but all of it is official.
  • Don't write code, write a macro.  For Microsoft Office applications that support macros, the macro language is VBA.  This means that when you create a macro, Word or Excel will actually write the code for you.  It is usually trivial to port VBA to Groovy/Scriptom.  This is an excellent way to figure out how to do obscure tasks in Office.

...