printing a html file progra

D

Dave F.

Hi
I'm using Office '03.

I've a couple of Q's regarding printing...

I've written a routine that copies the code from the vbe & converts it t
o html. I've then saved it to a file (test.htm).

1. What's the best way to print this file? I've found this routine
that loads it into an IE object:

Sub PrintHtml(fileName)
Dim objIE
Set objIE = wscript.CreateObject("InternetExplorer.Application", "ie_")
objIE.Visible = True
objIE.Navigate fileName
Do Until objIE.readyState = 4: wscript.sleep 20: Loop
print_done = False
' 6 = PRINT, 2 = NO USER PROMPT
objIE.ExecWB 6, 2
' Wait until printing id done.
Do While Not print_done: wscript.sleep 50: Loop
objIE.Quit
End Sub

I've never used ExecWB before. Is this the best way?

Is there a way to print the output of the file (not the source code)
without saving it to disk?

2. When printing is there a way to programmatically set the printer
driver properties. Specifically the option to print 2 pages on 1 sheet.
I'm guessing the drivers are manufacturer specific & have no idea how to
do this.

Your help would be much appreciated.

Cheers
Dave F.
Please note the email is cross posted to relevant multiple NG's to
obtain the quickest,most accurate answer.
 
C

Charlie Tame

I think you might get additional advice asking in the VS2005 groups and
places like http://www.codeproject.com/ in case someone has already tried
the same idea. Even if they used a different "Language" you may get some
good clues.

Sorry not to be more directly helpful but I think you may be right about
some drivers being specific.
 

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

Top