Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
Print web page
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Matthew  
View profile  
 More options Oct 11 2004, 2:27 pm
Newsgroups: microsoft.public.scripting.vbscript
From: "Matthew" <turn.deletet...@alltel.net>
Date: Mon, 11 Oct 2004 14:27:47 -0400
Local: Mon, Oct 11 2004 2:27 pm
Subject: Print web page
I found a script that lets a trusted web site print the page without the
user confirming it.

<script language="javascript1.2">
<!-- copyright(c) av...@yahoo.com
function print() {
var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0
CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
document.body.insertAdjacentHTML('beforeEnd', WebBrowser);

execScript("on error resume next: WebBrowser1.ExecWB 6, -1", "VBScript");
execScript('on error resume next: WebBrowser1.outerHTML = ""', 'VBScript');
</script>

I installed XP SP2 on my computer and this does not work any longer.  When I
open my web page, instead of just printing it displays the print dialog box.

I must confess, I don't know much about the VBS commands used.  If anybody
could provide at least a clue why XP SP2 is blocking it, that would be
helpful.

Thanks in advance,

Matthew


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
mayayana  
View profile  
 More options Oct 11 2004, 3:33 pm
Newsgroups: microsoft.public.scripting.vbscript
From: "mayayana" <mayaXXyan...@mindYYspring.com>
Date: Mon, 11 Oct 2004 19:33:37 GMT
Local: Mon, Oct 11 2004 3:33 pm
Subject: Re: Print web page
  I've never tried to do that, and I don't know how
WinXP SP2 might affect it. there have been a lot
of security changes. But it seems that you've
got it set to prompt the user:

object.ExecWB nCmdID, nCmdExecOpt, [pvaIn], [pvaOut]

   nCmdID for Print is 6, which you have, but the values
  for nCmdExecOpt are:

0 - do default
1 - prompt user
2 - don't prompt user
3 - show help

 You've got it as  -1. Maybe it will work if you try
it as 2:

execScript("on error resume next: WebBrowser1.ExecWB 6, 2", "VBScript");

--
--

Matthew <turn.deletet...@alltel.net> wrote in message

news:uw1AEA8rEHA.212@TK2MSFTNGP10.phx.gbl...


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Matthew  
View profile  
 More options Oct 17 2004, 11:35 pm
Newsgroups: microsoft.public.scripting.vbscript
From: "Matthew" <turn.deletet...@alltel.net>
Date: Sun, 17 Oct 2004 23:35:43 -0400
Local: Sun, Oct 17 2004 11:35 pm
Subject: Re: Print web page

Thanks for the response.  You are correct, I was doing it wrong.
I tested your suggestion on XP SP2, but it still doesn't work.

If you have any other ideas, my ears are wide open :-)

Matthew


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
mayayana  
View profile  
 More options Oct 17 2004, 11:56 pm
Newsgroups: microsoft.public.scripting.vbscript
From: "mayayana" <mayaXXyan...@mindYYspring.com>
Date: Mon, 18 Oct 2004 03:56:46 GMT
Local: Sun, Oct 17 2004 11:56 pm
Subject: Re: Print web page
  Sorry. I don't have much else for ideas, but if it stopped
with SP2 then that's certainly likely to be the culprit.
You said you were using it in the trusted zone. I'm not
sure that the new SP2 settings would affect that, but if
you're testing it locally then SP2 will affect it.

The SP2 white paper:
http://go.microsoft.com/fwlink/?LinkId=28022

This script will turn off the high security in IE local zone
that SP2 imposes. Just run it and click "No".
___________________________________
Dim sReg, SH, Ret, iVal, sType, s
s = "Click YES to set IE local lockdown."
s = s & " Click NO to unset restriction."
Ret = MsgBox(s, 36)
 Set SH = CreateObject("WScript.Shell")
   If (Ret = 6) Then
       iVal = 1
   Else
       iVal = 0
   End If
sReg = "Software\Microsoft\Internet Explorer\Main\"
sReg = sReg & "FeatureControl\FEATURE_LocalMachine_Lockdown\"

SH.RegWrite "HKLM\" & sReg & "IExplore.exe", iVal, "REG_DWORD"
SH.RegWrite "HKCU\" & sReg & "IExplore.exe", iVal, "REG_DWORD"

Set SH = Nothing
_________________________________

The following script will make local zone security
settings visible in IE security settings so that you
can check them:
____________________________________

Dim sReg, SH, Ret, iVal, sType, s
s = "Click YES to make IE Local Zone settings visible"
s = s & " in IE. Click NO to hide them."
Ret = MsgBox(s, 36)
 Set SH = CreateObject("WScript.Shell")
   If (Ret = 6) Then
       iVal = 1
   Else
       iVal = 33
   End If
sReg = "Software\Microsoft\Windows\CurrentVersion\"
sReg = sReg & "Internet Settings\Zones\0\Flags"
SH.RegWrite "HKLM\" & sReg, iVal, "REG_DWORD"
SH.RegWrite "HKCU\" & sReg, iVal, "REG_DWORD"
Set SH = Nothing

 If (Ret = 6) Then
   s = "The Local Zone should now be visible in IE"
   s = s & " security window as My Computer."
    MsgBox s, 64
 Else
   s = "Local Zone settings have been hidden."
    MsgBox s, 64
 End if

________________________________________

--

Matthew <turn.deletet...@alltel.net> wrote in message

news:#O9cNOMtEHA.2664@TK2MSFTNGP12.phx.gbl...


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Marty Tipipn  
View profile  
 More options Oct 23 2004, 10:27 pm
Newsgroups: microsoft.public.scripting.vbscript
From: g...@pobox.com (Marty Tipipn)
Date: 23 Oct 2004 19:27:35 -0700
Local: Sat, Oct 23 2004 10:27 pm
Subject: Re: Print web page

"Matthew" <turn.deletet...@alltel.net> wrote in message <news:#O9cNOMtEHA.2664@TK2MSFTNGP12.phx.gbl>...
> > You've got it as  -1. Maybe it will work if you try
> > it as 2:

> > execScript("on error resume next: WebBrowser1.ExecWB 6, 2", "VBScript");

> Thanks for the response.  You are correct, I was doing it wrong.
> I tested your suggestion on XP SP2, but it still doesn't work.

I had the exact same problem - and changing the second parameter from
-1 to 2 solved the problem. Printing works great under XP SP2 now.

-Marty


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
john.ames@gta-travel.com  
View profile  
 More options Nov 1 2004, 12:33 pm
Newsgroups: microsoft.public.scripting.vbscript
From: john ames (john.a...@gta-travel.com)
Date: Mon, 01 Nov 2004 09:33:04 -0800
Local: Mon, Nov 1 2004 12:33 pm
Subject: Re: Print web page
Matthew,

HAve you had any luck with getting this to work with XP SP2?

Fingers crossed!

Thank you......

John.

**********************************************************************
Sent via Fuzzy Software @ http://www.fuzzysoftware.com/
Comprehensive, categorised, searchable collection of links to ASP & ASP.NET resources...


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »