  Private Sub imprimir()

        Dim file As System.IO.StreamWriter = System.IO.File.CreateText("C:\temp.txt")

        file.WriteLine("NUMERO DE RECETA:     " + txt1.Text)
        file.WriteLine(Chr(13))
        file.WriteLine(txt2.Text + "   " + Mid(txt3.Text, 1, 40))
        file.WriteLine(Chr(13))
        file.WriteLine("No. DE AFILIACION:" + "  " + txt4.Text)
        file.WriteLine(Chr(13))
        file.WriteLine("NOMBRE:   " + txt5.Text)
        'file.WriteLine(Chr(13))

        file.WriteLine("POSOLOGIA:______________________________")
        file.WriteLine(Chr(13))

        file.WriteLine("----------------------------------------")
       
        file.WriteLine(txt1.Text + " " + "  " + Now)
        file.WriteLine("*** GRACIAS, ES UN PLACER ATENDERLE ***")

       
        file.WriteLine("       &n bsp; " + "DISPENSARIO")
        file.WriteLine("    TELEFONO:24676")
        file.WriteLine("----------------------------")
        'file.WriteLine(ticket)
        'file.Write(corte)
        file.Close()
        Try
             Shell("print /d:lpt1 C:\temp.txt", AppWinStyle.Hide)
        Catch ax As System.IO.FileNotFoundException
             MsgBox(ax.Message)
        End Try
    End Sub