Printing IE in VB

azdbacks
12-18-2003, 08:14 PM
I have a web link setup to a pdf. Using VB, I can open the the link using IE. Does anyone know how to automate printing the page from VB?

Thanks for the help.

Here is the code that I have so far:


Set Explorer = New SHDocVw.InternetExplorer
Explorer.Visible = True
Explorer.Navigate "http:\\phx01.phx.com/reports/issrpts/Allcodes.pdf"

'This is where I need to be able to print the pdf

Set Explorer = Nothing

azdbacks
12-21-2003, 03:21 PM
I was working in VB.net and this works.

I deleted the line:

ie.Visible = True

The focus is then put on the "Print" window, and then
"Enter" can be used. I would prefer a solution with a function,
but for now, I can settle with sendkeys.

ie = CreateObject("InternetExplorer.Application")
ie.Navigate("http://www.google.com")

System.Threading.Thread.Sleep(5000)
SendKeys.SendWait("^p")
System.Threading.Thread.Sleep(1000)
SendKeys.SendWait("{ENTER}")
System.Threading.Thread.Sleep(5000)
ie.Quit()

-azdbacks

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum