Forum: Ruby WIN32OLE InternetExplorer SaveAs command

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Derek Haskin (Guest)
on 2006-01-27 02:39
(Received via mailing list)
I've been trying to use the WIL32OLE to call the
InternetExplorer.ExecCommand SaveAs command.
I've been able to get it to work in the interface mode
where it displays a dialogue browser to save the file,
but have been unable to get it to work in
non-interface mode where you pass it the file to save
to.


Following is an extract of the code I am using.

require 'win32ole'
ie = WIN32OLE.new('InternetExplorer.Application')
ie.visible = true

myUrl = "http://www.google.com"

ie.navigate myUrl
sleep 1

ie.document.execCommand("SaveAs",false,"C:\\derek\\myFile.htm")
This topic is locked and can not be replied to.