From: daz Date: 2005-07-07T15:50:47+09:00 Subject: Re: win32ole help Ernest Ellingson wrote: > > require 'win32ole' > WinHttpRequestOption_EnableRedirects = 6 > web = WIN32OLE.new("WinHttp.WinHttpRequest.5.1") > web.Option(WinHttpRequestOption_EnableRedirects)= false # syntax error > EDIT (was same reply as Pit gave) I don't have WinHttp on this machine so I can't check this. > C:/RubyScripts/postFrostHTTP.rb:4:in `method_missing': Option > (WIN32OLERuntimeError) > OLE error code:80020004 in > > HRESULT error code:0x80020004 > Parameter not found. from C:/RubyScripts/postFrostHTTP.rb:4 > (( web.Option[6] = false )) If WIN32OLE is using the hash notation to access attributes, there would be a problem with a method called '6' (illegal). You could try examining the Option object with something like: web.Option.each { |opt| p opt } # might not have an 'each' method Use Ruby's "introspection" to nosey around and see what's available: # may be useful to quote on this newsgroup p web.Option.class puts '==========' puts((web.Option.methods - Object.methods).sort) puts '==========' puts((web.methods - Object.methods).sort) puts '==========' # If (e.g.) 'ole_methods' is in the list puts web.ole_methods I'm fairly confident with Ruby but I always have to mess around trying different hacks with COM objects. Someone who uses them twice a year is in much the same position as a COM newbie. daz