Code Bank
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingCode Bank

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old July 19th, 2005, 09:16 AM
tudela tudela is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2005
Posts: 9 tudela User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 32 m 28 sec
Reputation Power: 0
Send a message via ICQ to tudela Send a message via MSN to tudela Send a message via Yahoo to tudela
ActiveX for printing problems with WebForms

Hello, if you are having problems to manipulate page settings and printing options look at the code above

Paste this object at your HTML <body> content, do not change it.
Code:
<OBJECT ID="WebBrowser1" style="display:none"   CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2">
</OBJECT>

now, to control it you should create a script like this above
Code:
<script language="JavaScript">
 function printPage
 {
   WebBrowser1.ExecWB(6,1,null,null); 
 }
 function previewPage
 {
   WebBrowser1.ExecWB(7,1,null,null); 
 }
 function configurePage
 {
   WebBrowser1.ExecWB(8,1,null,null); 
 }
</script>



try this code:
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Object Test</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript">
	function PreviewPage()
	{
          WebBrowser1.ExecWB(7,1,null,null);		
	}
</script>
</head>
<body onLoad="PreviewPage()">
<OBJECT ID="WebBrowser1" style="display:none"    CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2">
</OBJECT>
</body>
</html>



note: This code doesn't work for other browsers than Internet Explorer.

Last edited by Shadow Wizard : July 23rd, 2005 at 01:53 PM. Reason: added [code] tags around code - please do it yourself next.

Reply With Quote
  #2  
Old July 23rd, 2005, 01:54 PM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
Click here for more information
 
Join Date: Sep 2004
Location: Israel
Posts: 29,260 Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 23rd Grade (Above 100000 Reputation Level)  Folding Points: 587728 Folding Title: Super Ultimate Folder - Level 2Folding Points: 587728 Folding Title: Super Ultimate Folder - Level 2Folding Points: 587728 Folding Title: Super Ultimate Folder - Level 2Folding Points: 587728 Folding Title: Super Ultimate Folder - Level 2Folding Points: 587728 Folding Title: Super Ultimate Folder - Level 2Folding Points: 587728 Folding Title: Super Ultimate Folder - Level 2Folding Points: 587728 Folding Title: Super Ultimate Folder - Level 2
Time spent in forums: 3 Months 2 Weeks 2 Days 32 m 33 sec
Reputation Power: 2509
nice, thanks.

Reply With Quote
  #3  
Old July 28th, 2005, 09:20 AM
tudela tudela is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2005
Posts: 9 tudela User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 32 m 28 sec
Reputation Power: 0
Send a message via ICQ to tudela Send a message via MSN to tudela Send a message via Yahoo to tudela
Another add-ins to the original code...

Well i was testing the code i posted and discovered some functionalities of the ExecWB function
Code:
// Calls the 'Open' function of the 'File' menu in the browser.
WebBrowser1.ExecWB(1,1,null,null)

// Calls the 'New' function of the 'File' menu in the browser.
WebBrowser1.ExecWB(2,1,null,null)

// Calls the 'Save' function of the 'File' menu in the browser.
WebBrowser1.ExecWB(3,1,null,null)

// Calls the 'Save As' function of the 'File' menu in the browser.
WebBrowser1.ExecWB(4,1,null,null)

// Calls the 'Save Copy As' function of the 'File' menu in the browser.
WebBrowser1.ExecWB(5,1,null,null)

// Calls the 'Print' function of the 'File' menu in the browser.
WebBrowser1.ExecWB(6,1,null,null)

// Calls the 'Preview' function of the 'File' menu in the browser.
WebBrowser1.ExecWB(7,1,null,null)

// Calls the 'Page Setup' function of the 'File' menu in the browser.
WebBrowser1.ExecWB(8,1,null,null)

// Calls the 'Spell' function of the 'Tools' menu in the browser.
WebBrowser1.ExecWB(9,1,null,null)

// Calls the 'Properties' function of the 'File' menu in the browser.
WebBrowser1.ExecWB(10,1,null,null)

// Calls the 'Cut' function of the 'Edit' menu in the browser.
WebBrowser1.ExecWB(11,1,null,null)

// Calls the 'Copy' function of the 'Edit' menu in the browser.
WebBrowser1.ExecWB(12,1,null,null)

// Calls the 'Paste' function of the 'Edit' menu in the browser.
WebBrowser1.ExecWB(13,1,null,null)

// Calls the 'Paste Especial' function of the 'Edit' menu in the browser.
WebBrowser1.ExecWB(14,1,null,null)

// Calls the 'Undo' function of the 'Edit' menu in the browser.
WebBrowser1.ExecWB(15,1,null,null)

// Calls the 'Redo' function of the 'Edit' menu in the browser.
WebBrowser1.ExecWB(16,1,null,null)

// Calls the 'Select All' function of the 'Edit' menu in the browser.
WebBrowser1.ExecWB(17,1,null,null)

// Calls the 'Clear Selection' function of the 'Edit' menu in the browser.
WebBrowser1.ExecWB(18,1,null,null)

// Calls the 'Zoom' function of the 'View' menu in the browser.
WebBrowser1.ExecWB(19,1,null,null)

// Calls the 'Refresh' function of the browser.
WebBrowser1.ExecWB(22,1,null,null)

// Calls the 'Stop' function of the browser.
WebBrowser1.ExecWB(23,1,null,null)

// Calls the 'Find' function of the browser.
WebBrowser1.ExecWB(32,1,null,null)

Thats all for now...

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingCode Bank > Object for printing problems with WebForms


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump





 Free IT White Papers!
 
Create the Optimal Architecture for your Critical Applications
Warburton's the largest independently owned bakery in the UK faced a number of difficult challenges in providing the most robust yet efficient IT infrastructure for their organization's success. IBM's services combined with their xSeries servers created the perfect platform for their SAP environment with sufficient flexibility, and did so in very time effective fashion.

 
Five Best Practices for Deploying a Successful Service-Oriented Architecture
This white paper describes the benefits you can expect with SOA, and how IBM can help take your business there.

 
Gartner Magic Quadrant for Application Delivery Controllers
Gartner summarizes its view on Application Delivery Controllers, evaluates strengths and weaknesses of solutions, and provides Magic Quadrant reporting for a quick comparison across all vendors. Learn from Gartner how you can benefit from an all-in-one device like Citrix NetScaler that delivers the highest levels of availability, performance and security.

 
Knowledge is Power
What you don't know can hurt you, and is likely costing you money and increasing your security risks during an era of scarce resources. This white paper proposes six key strategies that enterprise security managers can use to improve their network defense posture.

 
Rationalizing the Multi-Tool Environment
The rationalized multi-tool approach is flexible, scalable and cost effective. It provides the necessary input to the IT service management business processes. It preserves prior investments in monitoring tools, empowers technologists to select the best tools with which to do their jobs, and enhances effective response to incidents.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2010 by Developer Shed. All rights reserved. DS Cluster 7 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek