win32ole and printing from ie

H

Hal Fulton

I'm trying to figure out how to control Internet Explorer and go to
a certain URL and print the page.

The first part is easy.

Printing, I have no clue.

Anyone?


Thanks,
Hal
 
C

Carlos Tirado

----- Original Message ---------------
I'm trying to figure out how to control Internet Explorer
and go to a certain URL and print the page.

The first part is easy.

Printing, I have no clue.

Anyone?

This works for me:

#
# use IE, navigate, print
#
url = 'http://www.ruby-lang.org/'

require "win32ole"

ie = WIN32OLE.new('InternetExplorer.Application')
ie.visible = TRUE;
ie.navigate({'url'=>url})
sleep 0.01 while (ie.busy)

script = ie.document.script
printme = script.print();
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top