
Using VBScript ActiveX Control in VB-Application
Im very frustrated, because i dont know about the resolution for Problem
:-(
I make it so.
This Code is in VB:
NewFrmMain.VBScripting.AddObject "objPrint", Printer, True
and this in VBS:
Sub PrintHeader ()
Dim strText
objPrint.Orientation = vbPRORPortrait
With objPrint
strText = "Sample Text"
.FontName = "Arial"
.FontSize = 13
.FontBold = True
.CurrentX = 400
.CurrentY = 600
End With
objPrint.Print strText --> 'Err.Number = 438, Object doesnt support this
property or Method'
objPrint.EndDoc
the Rest of code is OK
Thank you, for your help
Quote:
----- Original Message -----
Newsgroups: microsoft.public.scripting.vbscript
Sent: Sunday, September 10, 2000 12:18 AM
Subject: Re: Using VBScript ActiveX Control in VB-Application
> Are you assuming that the VB Printer object will automatically be visible
to
> VBScript executing within the ScriptControl? You need to expose it via
the
> ScriptControl's AddObject method...
> --
> Michael Harris
> Microsoft.MVP.Scripting
> --
> > Hey Specialists
> > i would like print to windows-standard-printer over vb-script Control
1.0,
> > which is included in my VB6 Application.
> > The initialization is ok, unfortunately the command Printer.Print
"Sample
> > Text" do not work.
> > Thank You
> > Mike