* How do I control printing to a Dot Matrix Printer 
Author Message
 * How do I control printing to a Dot Matrix Printer

I'm working on a VB function that is suppose to send
formated text to a printer without user intervention. I'm
using the printeropen function to hit any printer on the
network.

I can get simple text out but I can't get the printer to do
newlines. Looks like it's using the EBCDIC characters set.
My chr(10) chr(13) are comming out as characters. How can I
embed printer controls in my string. I'm talking to and IBM
4232.

Also from a printer handel like OpenPrinter returns how do
it get a printer object so that I can control fonts, page
size, and margins.

Thank you in advance  :)

Regards,
Vijay Bhatter, MCSD
http://www.{*filter*}ax.net/vijay



Wed, 13 Aug 2003 12:45:11 GMT  
 * How do I control printing to a Dot Matrix Printer
If you've actually got chr(10) chr(13) in that order, try reversing them.
chr(10) is Line Feed, chr(13) is Carriage Return. When using them together,
you want the Carriage Return first. There's also an intrinsic variables
vbCrLf that represents the two values in the correct order.

BTW, this has nothing to do with most of the groups to which you posted the
question. A post to strictly microsoft.public.vb.general.discussion would
have been far more appropriate.

--

Doug Steele, Microsoft Access MVP
Beer, Wine and Database Programming. What could be better?
Visit "Doug Steele's Beer and Programming Emporium"
http://www.*-*-*.com/


Quote:
> I'm working on a VB function that is suppose to send
> formated text to a printer without user intervention. I'm
> using the printeropen function to hit any printer on the
> network.

> I can get simple text out but I can't get the printer to do
> newlines. Looks like it's using the EBCDIC characters set.
> My chr(10) chr(13) are comming out as characters. How can I
> embed printer controls in my string. I'm talking to and IBM
> 4232.

> Also from a printer handel like OpenPrinter returns how do
> it get a printer object so that I can control fonts, page
> size, and margins.

> Thank you in advance  :)

> Regards,
> Vijay Bhatter, MCSD
> http://www.{*filter*}ax.net/vijay



Wed, 13 Aug 2003 20:59:18 GMT  
 * How do I control printing to a Dot Matrix Printer
Vojay, you may want to try something like this code as it works very
well for me.

'Set the FontName and the Font Size and FontStyle

 With CommonDialog1
    .Flags = cdlCFPrinterFonts Or cdlCFForceFontExist ' Or  whatever
'other flags you want....
    .FontName = "Arial"
    .FontBold = False
    .FontSize = 8
    .FontItalic = False
    ' etc...

    .ShowFont

    ' get the chosen characteristics....
    Printer.FontName = .FontName
    Printer.FontBold = .FontBold
    Printer.FontSize = .FontSize
    Printer.FontItalic = .FontItalic
    ' etc...
  End With

' Print the Results of the Calculator and Explainations
    Printer.Print " "
    Printer.Print " "

Printer.Print Tab(30); " General Design Dimentions"
Printer.Print " "
Printer.Print " "
Printer.Print Tab(10); "Wing Span  = "; Format(frmCalc.txtWingSpan,
"##.##"); " Inches"
Printer.EndDoc
--
Guy Fuller
ICQ# 26561523
AMA 667982

                +++ STARCAD PLANS +++
       National Flying Site Directory/Database
Your site on the Internet for FREE Model Airplane Plans
  Bookmark this site for the fantastic resource it is.
             http://www.starcadplans.com/



Thu, 14 Aug 2003 09:54:01 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. * How do I control printing to a Dot Matrix Printer

2. * How do I control printing to a Dot Matrix Printer

3. Controlling Dot-matrix printer using print method

4. * How do I control printing to a Dot Matrix Printer

5. * How do I control printing to a Dot Matrix Printer

6. Printing a fixed width text file to dot matrix printer

7. how to print reports at dot matrix printer?

8. Printing to dot-matrix printer...help!

9. Printing in text mode to dot matrix printer

10. printing speed in Dot Matrix printer vary slow

11. Slow Printing in Dot Matrix Printer

12. CR6 + VB6 Printing at dot matrix printers

 

 
Powered by phpBB® Forum Software