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.
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.