Zach Dennis:
I guess I meant documentation for using WIN32OLE and WScript...etc... I
know that, documentation is one thing MS is good at... I didn't mean to
imply there wasn't documentation on WSH.
Well, you're right then. But it is pretty simple. So simple I'm going to
document it right now (ruby-doc.org?).
This is WIN32OLE, from VB:
require 'win32ole'
# Set my_com_object = CreateObject("Library.Class")
my_com_object = WIN32OLE.new("Library.Class")
# Set my_com_object = GetObject("Library.Class")
my_com_object = WIN32OLE.connect("Library.Class")
# For Each com_object In com_collection_object
# '...
# Next
for com_object in com_collection_object
#...
end
# (Press F1 and read the help?)
com_object.ole_methods #=> [Array, Of, All, Methods, And, Properties,
#=> Available, For, This, Object]
And the rest is straightforward. COM properties and methods become methods
of the WIN32OLE object. If there's a Ruby name clash (e.g. a "class"
property), you can either change the case of the method (COM's case
insensitive) (com_object.Class or com_object.cLaSs) or use [] and []=
(com_object['class'] is an lvar).
Cheers,
Dave