Problem to send information in the textbox to printer.


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Problem to send information in the textbox to printer.

  1. #1
    Juan Palazzolo Guest

    Problem to send information in the textbox to printer.


    Hi:

    My english is very poor, sorry. But i have a problem to send text to printer.
    some body help me
    yesterday, but i paste the code he send me and the problem continue.

    My first rutine was:

    Private Sub imprimir_Click()
    Dim BeginPage, EndPage, NumCopies, i
    ' Establecer CancelError a True
    CommonDialog1.CancelError = True
    On Error GoTo ErrHandler
    ' Presentar el cuadro de diálogo Imprimir
    CommonDialog1.ShowPrinter
    ' Obtener los valores seleccionados por el usuario en el cuadro de diálogo
    BeginPage = CommonDialog1.FromPage
    EndPage = CommonDialog1.ToPage
    NumCopies = CommonDialog1.Copies
    For i = 1 To NumCopies

    ' Code to send text to printer


    Next i

    Exit Sub
    ErrHandler:
    ' El usuario ha hecho clic en el botón Cancelar
    Exit Sub
    End Sub

    NOW MY RUTINE IS:


    Private Sub imprimir_Click()
    Dim BeginPage, EndPage, NumCopies, i
    ' Establecer CancelError a True
    CommonDialog1.CancelError = True
    On Error GoTo ErrHandler
    ' Presentar el cuadro de diálogo Imprimir
    CommonDialog1.ShowPrinter
    ' Obtener los valores seleccionados por el usuario en el cuadro de diálogo
    BeginPage = CommonDialog1.FromPage
    EndPage = CommonDialog1.ToPage
    NumCopies = CommonDialog1.Copies
    For i = 1 To NumCopies

    ' Código para enviar los datos a la impresora

    Printer.Print Text1

    Printer.EndDoc

    Next i

    Exit Sub
    ErrHandler:
    ' El usuario ha hecho clic en el botón Cancelar
    Exit Sub

    End Sub


    This rutine doesn´t work. Please tell me how can i do.
    I really apreciate your help. If some one want to write me or contact me
    in the other way to help me,
    please write to my mail or contact me on ICQ.

    pd: I have Hp 400 printer

    Thanks a lot.

    Juan Felipe Palazzolo Pino
    Santiago
    Chile
    ICQ 16497572
    jfpalazzolo@engineer.com

  2. #2
    M. Yang Guest

    Re: Problem to send information in the textbox to printer.


    To make your rotine work, just add a commondialog control and a pair of double
    quotes:

    Printer.Print "Text1"

    M. Yang
    --------------------------

    "Juan Palazzolo" <jfpalazzolo@engineer.com> wrote:
    >
    >Hi:
    >
    >My english is very poor, sorry. But i have a problem to send text to printer.
    >some body help me
    >yesterday, but i paste the code he send me and the problem continue.
    >
    >My first rutine was:
    >
    >Private Sub imprimir_Click()
    >Dim BeginPage, EndPage, NumCopies, i
    >' Establecer CancelError a True
    >CommonDialog1.CancelError = True
    >On Error GoTo ErrHandler
    >' Presentar el cuadro de diálogo Imprimir
    >CommonDialog1.ShowPrinter
    >' Obtener los valores seleccionados por el usuario en el cuadro de diálogo
    >BeginPage = CommonDialog1.FromPage
    >EndPage = CommonDialog1.ToPage
    >NumCopies = CommonDialog1.Copies
    >For i = 1 To NumCopies
    >
    >' Code to send text to printer
    >
    >
    >Next i
    >
    >Exit Sub
    >ErrHandler:
    >' El usuario ha hecho clic en el botón Cancelar
    >Exit Sub
    >End Sub
    >
    >NOW MY RUTINE IS:
    >
    >
    >Private Sub imprimir_Click()
    >Dim BeginPage, EndPage, NumCopies, i
    >' Establecer CancelError a True
    >CommonDialog1.CancelError = True
    >On Error GoTo ErrHandler
    >' Presentar el cuadro de diálogo Imprimir
    >CommonDialog1.ShowPrinter
    >' Obtener los valores seleccionados por el usuario en el cuadro de diálogo
    >BeginPage = CommonDialog1.FromPage
    >EndPage = CommonDialog1.ToPage
    >NumCopies = CommonDialog1.Copies
    >For i = 1 To NumCopies
    >
    >' Código para enviar los datos a la impresora
    >
    >Printer.Print Text1
    >
    >Printer.EndDoc
    >
    >Next i
    >
    >Exit Sub
    >ErrHandler:
    >' El usuario ha hecho clic en el botón Cancelar
    >Exit Sub
    >
    >End Sub
    >
    >
    >This rutine doesn´t work. Please tell me how can i do.
    >I really apreciate your help. If some one want to write me or contact me
    >in the other way to help me,
    >please write to my mail or contact me on ICQ.
    >
    >pd: I have Hp 400 printer
    >
    >Thanks a lot.
    >
    >Juan Felipe Palazzolo Pino
    >Santiago
    >Chile
    >ICQ 16497572
    >jfpalazzolo@engineer.com



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center