From: Bilbo Date: 2003-04-19T08:55:47+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 > ***************************************************** > > ====================================================================== > Hi. Her is th Ms Website describing the post method. I I have done this in Vb but not Ruby. Here is th MS website describing the use of Post. http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q174923& Here is some VB code if it helps a bit: inUrl as String = "http://www.zargon12.com" inFlags As Long = 0 inTargetFrame As String = "" inPostData As Variant = "Start=0&Count=None&State=No&City=Detroit" inHeaders as String = "Content-Type: application/x-www-form- urlencoded" & vbCrLf x.navigate inUrl, inFlags, inTargetFrame, BuildPostData(inPostData), inHeaders Private Function BuildPostData(ByVal inPostData As String) As Byte() BuildPostData = StrConv(inPostData, vbFromUnicode) End Function There is a Unicode concern as well in VB. Hope this helps some Murray ========================================================================