R
Richard
Hi,
I'm running WinXP/SP2 and Ruby 1.8.2. I tried the sample below from The
Ruby Way,2nd ed., with modified HTML (which I tested independently).
When I run it in a Command Window, I get:
K:\_Projects\Ruby\_Ruby_Techniques\Win32Ole>TestingOleWithHtml.rb
K:/_Projects/Ruby/_Ruby_Techniques/Win32Ole/TestingOleWithHtml.rb:22:in
`method_missing': document (WIN32OLERuntimeError)
OLE error code:80004005 in <Unknown>
<No Description>
HRESULT error code:0x80020009
Exception occurred. from
K:/_Projects/Ruby/_Ruby_Techniques/Win32Ole/TestingOleWithHtml.rb:22
Any ideas?
Thanks in Advance,
Richard
# Source: The Ruby Way, 2nd ed., pg. 585
require "win32ole"
msg = "Hello, World"
html = <<EOF
<html>
<head>
<title>Hello, World</title>
</head>
<body>
<h1><center>My "Hello, World" Demo</center></h1>
<p>
<h2><center>Not much of a demo, eh?</center></h2>
</body>
</html>
EOF
ie = WIN32OLE.new("InternetExplorer.Application")
ie.document.open # <====
Line 22
ie.document.write html
ie.document.close
sleep 5
quit
I'm running WinXP/SP2 and Ruby 1.8.2. I tried the sample below from The
Ruby Way,2nd ed., with modified HTML (which I tested independently).
When I run it in a Command Window, I get:
K:\_Projects\Ruby\_Ruby_Techniques\Win32Ole>TestingOleWithHtml.rb
K:/_Projects/Ruby/_Ruby_Techniques/Win32Ole/TestingOleWithHtml.rb:22:in
`method_missing': document (WIN32OLERuntimeError)
OLE error code:80004005 in <Unknown>
<No Description>
HRESULT error code:0x80020009
Exception occurred. from
K:/_Projects/Ruby/_Ruby_Techniques/Win32Ole/TestingOleWithHtml.rb:22
Any ideas?
Thanks in Advance,
Richard
# Source: The Ruby Way, 2nd ed., pg. 585
require "win32ole"
msg = "Hello, World"
html = <<EOF
<html>
<head>
<title>Hello, World</title>
</head>
<body>
<h1><center>My "Hello, World" Demo</center></h1>
<p>
<h2><center>Not much of a demo, eh?</center></h2>
</body>
</html>
EOF
ie = WIN32OLE.new("InternetExplorer.Application")
ie.document.open # <====
Line 22
ie.document.write html
ie.document.close
sleep 5
quit