Win32ole question

I have a 3rd party COM library, and this works in VBScript:

Set foo = CreateObject(“Foo”)
foo.Fields(“FieldA”) = 5
foo.Fields(“FieldB”) = “bar”
WScript.Echo foo.Fields(“FieldA”)
WScript.Echo foo.Fields(“FieldB”)

but I can’t get the assignments to work in ruby:

foo =“Foo”)
foo.Fields(“FieldA”) = 5

it errors out on this, because the evaluation up until the assignment of
results in a Fixnum instance that has no “=” method or somesuch. I
there’s a way to workaround this with something like the _setproperty
but I couldn’t wrap my brain around it today. Anyone have a hint? Or is
a weird edge case in the land of COM that win32ole can’t work with?


To set properties with win32ole, use the property syntax, rather than
accessing the property via method:

foo[“FieldA”] = 5

Mitchell H.