Help with printing IE, please?

E

Ed from AZ

I'm on XPpro, IE6sp2. I'm trying to use a VBA macro in Word 2003 to
open files in an instance of IE and print the file. I was hoping to
use a bit of JavaScript to accomplish the printing. I've searched a
lot of newsgroups and other sites, but can't get a handle on this.
I'm using IE because I have files of a type not easily handled by VBA,
but will open in IE.

In another VBA code (this one from Excel 2003), I ran some JavaScripts
using syntax like:

Dim strMax As String
strMax =
"javascript:moveTo(0,0);resizeTo(screen.availWidth,screen.availHeight-20)"
Call docIE.ParentWindow.execScript(strMax, "JavaScript")

The code I am currently using is:

Dim objIE As Object
Dim docIE
Dim winIE

On Error GoTo EndMe

Set objIE = CreateObject("InternetExplorer.Application")
objIE.Navigate "C:\Documents and Settings\UserName\Desktop\MyFile.pdf"
objIE.Visible = True
Set docIE = objIE.Document
Stop
Set winIE = docIE.ParentWindow
winIE.Print

But this errors at trying to set the winIE object, which would make it
pretty difficult to use the .execScript() method.

Any suggestions?

Ed
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top