From: Bilbo Date: 2003-04-20T10:00:49+09:00 Subject: Re: Win32OLE help In article <3EA01D2E.7412.18CD4BB@localhost>, walter@mwsewall.com says... > > Can someone point me to some more information on using Win32OLE. I > have looked for several hours and can't seem to find what should be > an obvious answer. I should mention that I have never used OLE > before. > > What I want to do is launch InternetExplorer in such a way that it > will open the same window if called more than once and the command is > a Post command. > > it is very easy to do a GET in a new IE window such as the following: > > require 'win32ole' > ie = WIN32OLE.new('InternetExplorer.Application') > ie.visible = true > ie.navigate('http://url?field=data&field2=data2') > > The OLE docs state that navigate will take optional parameters that > are of type VARIANT. One is used to name the window, another is used > to set the Post Data. The problem is I just do not know how to set > them. It seems so trivial, and yet I am just missing something. > > Any insight into this would be greatly appreciated. > > > Thanks in advance, > > > Walt > > ***************************************************** > Walter Szewelanczyk > IS Director > M.W. Sewall & CO. email : walter@mwsewall.com > 259 Front St. Phone : (207) 442-7994 x 128 > Bath, ME 04530 Fax : (207) 443-6284 > ***************************************************** > > > =================================================================== THIS SAMPLE DOES NOT WORK BUT IT Should BE CLOSE. As I am a Ruby newbie this is the best I can do. This wworks in VB. Murray # Postdata sample require 'win32ole' heading = "Content-Type: application/x-www-form-urlencoded\n" url = "http://www.tyzo.com/cgi-bin/hotels.cgi" postData = "Start=0&Count=None&City=&Country=No&State=" postData += 'Hawaii' frame = "" zero = 0 puts postData puts heading puts url ie = WIN32OLE.new('InternetExplorer.Application') ie.visible = true ie.toolbar = false ie.statusbar = false ie.navigate(url,zero,frame,postData,heading) ================================================================