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
ASP Free God 45th Plane (27000 - 27499 posts)
 
Join Date: Sep 2004
Location: Israel
Posts: 27,243 Shadow Wizard User rank is General 12nd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 12nd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 12nd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 12nd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 12nd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 12nd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 12nd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 12nd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 12nd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 12nd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 12nd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 12nd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 12nd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 12nd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 12nd Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 12nd Grade (Above 100000 Reputation Level)  Folding Points: 354839 Folding Title: Super Ultimate Folder - Level 1Folding Points: 354839 Folding Title: Super Ultimate Folder - Level 1Folding Points: 354839 Folding Title: Super Ultimate Folder - Level 1Folding Points: 354839 Folding Title: Super Ultimate Folder - Level 1Folding Points: 354839 Folding Title: Super Ultimate Folder - Level 1Folding Points: 354839 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 1 Week 6 Days 9 h 53 m 44 sec
Reputation Power: 1777
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


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





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT