Printing with VBScript

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>
fusion123Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mgfranzCommented:
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
fusion123Author Commented:
in frame 1 i have the the script, and button. I'm try'n to print frame 2.
0
srinivas_arellaCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Development

From novice to tech pro — start learning today.