Print via VB-Script ActiveX-Control in VB-Application 
Author Message
 Print via VB-Script ActiveX-Control in VB-Application

Im very frustrated, because i dont know about the resolution of this
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



Sun, 02 Mar 2003 21:35:34 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Using VBScript ActiveX Control in VB-Application

2. Using VBScript ActiveX Control in VB-Application

3. ActiveX controls from VB Script

4. trying to populate treeview control in activex using vb script

5. ActiveX controls with VB Script

6. VB application as ActiveX Scripting Host

7. Passing control from VB to VB Script -- need to access SetFocus in script

8. Help: Talking to VB5 created ActiveX controls via Scripts in Web Page

9. Using ActiveX or Script to Access Remote Mail Server via HTA Application

10. Using ActiveX or Script to Access Remote Mail Server via HTA Application

11. Using ActiveX or Script to Access Remote Mail Server via HTA Application

12. How to control other applications via VB?

 

 
Powered by phpBB® Forum Software