Windows Thread, Scheduling a webpage print task in Technical; Our school's notices take the form of a web-page which is printed every morning and circulated in registers. Does anyone ...
-
26th September 2006, 11:34 AM #1 Scheduling a webpage print task
Our school's notices take the form of a web-page which is printed every morning and circulated in registers. Does anyone know how I can schedule the particular web-page to be printed every day at a given time automatically so that a nice big pile of notices is sitting waiting for collection from a printer first thing each morning?
Since this would be unattended obviously any solution must not require user input.
-
-
IDG Tech News
-
26th September 2006, 12:09 PM #2 Re: Scheduling a webpage print task
How about:
Code:
Option Explicit
Dim objShell
Set objShell = CreateObject("WScript.Shell")
objShell.Run "c:\temp\test.htm"
Wscript.Sleep 1000
objShell.SendKeys "^p"
WScript.Sleep 1000
objShell.SendKeys "{tab}"
WScript.Sleep 300
objShell.SendKeys "p"
WScript.Sleep 1000
objShell.SendKeys "%"
WScript.Sleep 100
objShell.SendKeys "f"
WScript.Sleep 100
objShell.SendKeys "c"
WScript.Quit Just change the filename to the html file you wish to open.
Ben
-
-
26th September 2006, 12:40 PM #3 Re: Scheduling a webpage print task

Originally Posted by
plexer How about
:
Code:
Option Explicit
Dim objShell
Set objShell = CreateObject("WScript.Shell")
objShell.Run "c:\temp\test.htm"
Wscript.Sleep 1000
objShell.SendKeys "^p"
WScript.Sleep 1000
objShell.SendKeys "{tab}"
WScript.Sleep 300
objShell.SendKeys "p"
WScript.Sleep 1000
objShell.SendKeys "%"
WScript.Sleep 100
objShell.SendKeys "f"
WScript.Sleep 100
objShell.SendKeys "c"
WScript.Quit Just change the filename to the html file you wish to open.
Ben
Couldnt you simplify it and just use this from the site below :
http://sastools.com/b2/post/79393894
But use it in a vbscript and just use windows scheduling ( http://www.iopus.com/guides/winscheduler.htm ) to assign the vbscript to execute that each morning 
Sendkeys is a bit dangerous considering that you have to ensure that the app or file you need to do things on has to be in focus otherwise you will end up doing other things.
-
-
26th September 2006, 12:51 PM #4 Re: Scheduling a webpage print task
AutoIt us bette for sending keys and making sure windows are active etc.
-
-
26th September 2006, 01:14 PM #5 Re: Scheduling a webpage print task
Code:
Option Explicit
Dim objShell
Set objShell = CreateObject("WScript.Shell")
objShell.Run "rundll32.exe mshtml.dll,PrintHTML test.html"
WScript.Quit Then.
Ben
-
-
26th September 2006, 03:10 PM #6 Re: Scheduling a webpage print task
Or you could just cut that down to one line with a batch script...... :P nah I'm joking VBS always behaves nicer in most circumstances.
-
-
26th September 2006, 03:15 PM #7 Re: Scheduling a webpage print task
Or schedule rundll32.exe to run with the parameters mshtml.dll,PrintHTML test.html ... 8)
-
-
26th September 2006, 03:54 PM #8 Re: Scheduling a webpage print task
That'd do it as well.
I'm going to give up I think.
Ben
-
-
26th September 2006, 04:17 PM #9 Re: Scheduling a webpage print task
I take it somebody's had their head buried in a VBScript help file/manual all day then Ben?
-
-
26th September 2006, 04:18 PM #10 Re: Scheduling a webpage print task
Not really no just been looking at stuff throughout the day I tested my senkeys one and it worked ok but there are other ways too.
Ben
-
-
26th September 2006, 04:23 PM #11
- Rep Power
- 0
Re: Scheduling a webpage print task

Originally Posted by
webman Or schedule rundll32.exe to run with the parameters mshtml.dll,PrintHTML test.html ... 8)
I see you brought your razor Mr. Occam
-
-
26th September 2006, 04:31 PM #12 Re: Scheduling a webpage print task
Why yes... yes I did
-
-
26th September 2006, 06:51 PM #13 Re: Scheduling a webpage print task
Thanks for all those sugestions, its working fine now.
-
-
26th September 2006, 08:10 PM #14
- Rep Power
- 16
Re: Scheduling a webpage print task

Originally Posted by
NetworkGeezer I see you brought your razor Mr. Occam

As this is EduGeek that should be
I see you brought your iron Mr. Sheppard
-
-
26th September 2006, 10:41 PM #15 Re: Scheduling a webpage print task
I'm getting board of all these ironing jokes now :?
Sorry 8)
-
SHARE: 
Similar Threads
-
By Zoom7000 in forum General Chat
Replies: 26
Last Post: 4th June 2008, 12:03 PM
-
By Blind in forum Windows
Replies: 7
Last Post: 22nd October 2007, 10:05 PM
-
By drewinc in forum Windows
Replies: 8
Last Post: 22nd May 2007, 09:02 AM
-
By timbo343 in forum Windows
Replies: 1
Last Post: 8th February 2007, 10:34 AM
-
By Mintsoft in forum Windows
Replies: 9
Last Post: 9th March 2006, 11:44 AM
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules