[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

Printing with VBScript

Posted on 2000-02-11
3
Medium Priority
?
621 Views
Last Modified: 2013-12-25
I am trying to get this script to print anouther frame.

It prints the frame it resides in noprob. but is there away I can target a frame other than the one it's in?

<OBJECT ID=WBCONTROL WIDTH=0 HEIGHT=0 CLASSID=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2></OBJECT>
<SCRIPT LANGUAGE=VBSCRIPT>
Sub VBPrint() On Error Resume Next
WBControl.ExecWB 6,1
End Sub
</SCRIPT>

<SCRIPT LANGUAGE=JAVASCRIPT>
if (navigator.appName.indexOf('Microsoft') !=-1)
document.write('<FORM><INPUT TYPE="BUTTON" ONCLICK="VBPrint()" VALUE="Print"></FORM>');
else if (self.print)
document.write('<FORM><INPUT TYPE="BUTTON" ONCLICK="top.main.print()" VALUE="Print"></FORM>');
</SCRIPT>
0
Comment
Question by:fusion123
3 Comments
 
LVL 18

Expert Comment

by:mgfranz
ID: 2512558
Can you target the frame you want to print to?

<INPUT TYPE="BUTTON" ONCLICK="VBPrint()" VALUE="Print" target="FrameName">

Or are you trying to print a different frame, (frame2), by calling the print() from frame1?
0
 

Author Comment

by:fusion123
ID: 2513143
in frame 1 i have the the script, and button. I'm try'n to print frame 2.
0
 
LVL 1

Accepted Solution

by:
srinivas_arella earned 100 total points
ID: 2517416
u can do this.

write the printing code in the parent document and then, whenever u need to print use this code.

<INPUT TYPE="BUTTON" ONCLICK="parent.VBPrint()" VALUE="Print" target="FrameName">

this will do the job.

0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
No other job is as rewarding and demanding as building an iPhone app is. It is not really in the hands of the developer for the success of an iPhone app. Many factors operate jointly for every iOS application's success in the market.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This video teaches users how to migrate an existing Wordpress website to a new domain.
Suggested Courses

612 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question