Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Printing in MS-DOS mode from VB6

522 views
Skip to first unread message

Alex Molina

unread,
Apr 4, 2001, 8:59:36 PM4/4/01
to
I need to know how to send text in mode
MS-DOS like CLIPPER and MS-FOXPRO, because the printing is more fast and my
customer is very angry with the mode graphic, but....

I don't know how to control or define the printing mode, like:
Condensed, Draft, Roman, etc.

I can send in Draft mode (10 cpi) over a "Generic only/text" printer using
the:

Open "testfile" For Output As #1

and;

Print #1, Chr(13) & Chr(13)

commands, but, can anybody tell me, how to change de printing mode? or, if
you know another best way to do this ?

:)
Alex Molina


Guido Felgenträger

unread,
Apr 5, 2001, 3:06:35 PM4/5/01
to
Therefor you have to know the control-codes the destination printer
understands.

For example:
I've got an old 24-dot-matrix-printer compatible to Epson-LQ-860.
Some of his control-codes are (# are decimal)

Draft-Quality: <ESC> "x" 0
Letter-Quality: <ESC> "x" 1
LQ-Font Times Roman : <ESC> "k" 0
Sanserif 1
Courier 2
Prestige 3
Script 4
other 5..15 optional printer-depending
Printer-Default: <ESC> "t" 0

Pica (10cpi) : <ESC> "P"
Elite (12cpi) "M"

condensed on : 15 (Pica: 17cpi; Elite 20cpi)
off 18

wide on : <ESC> "W" 1 (Pica: 5cpi; Elite 6cpi)
off 0

bold on : <ESC> "E"
off "F"

shadow on : <ESC> "G"
off "H"

underline on : <ESC> "-" 1
off 0

italic on : <ESC> "4"
off "5"


Lines 1/6 inch : <ESC> "2"
1/8 "0"

page length : n lines : <ESC> "C" n {n = 1..127}
n inches: <ESC> "C" 0 n {n = 1..32}

this means for Letter-quality; Sanserif; 20cpi; underlined; 1/6 lpi

ESC$ = chr$(27)
Print #1, ESC & "x" & chr$(1) _
& ESC & "k" & chr$(1) _
& ESC & "M" _
& chr$(15) _
& ESC & "-" & chr$(1) _
& ESC "2";

Hope this helps.


Alex Molina schrieb:

jim_w

unread,
Apr 5, 2001, 3:30:03 PM4/5/01
to
Alex, if you are posting in this newsgroup, I presume you are using vb (or
vba) to program with.

If that's the case, you don't really need any api calls, just go back to
your help file and look up the "printer object".

More specifically, if you want to set the printer font, then use the printer
object's font properties:

oPrinter.FontName = "Roman"
oPrinter.FontSize = 10 ' (10pts)
oPrinter.PrintQuality = vbPRPQDraft ' (draft quality)

Of course, it IS possible to print using api's (I can give you an example if
you wish), but hey!... why not take advantage of vb-magic?

cheers, jw

"Alex Molina" <gen...@yahoo.com> wrote in message
news:uWPiVQXvAHA.1796@tkmsftngp02...

Alex Molina

unread,
Apr 9, 2001, 1:09:17 PM4/9/01
to
Thank you Guido, of course you help me!

:)
Alex Molina

Guido Felgenträger <Guido.Fel...@t-online.de> escribió en el mensaje
de noticias 3ACCC23B...@t-online.de...

Alex Molina

unread,
Apr 9, 2001, 1:10:31 PM4/9/01
to
Thank you Jim, but Guido already guides me well.

Thank you very much!

:)
Alex Molina

jim_w <jwarrington*noSteekin*@*Spam*worldnet.att.net> escribió en el mensaje
de noticias #97vMdgvAHA.1996@tkmsftngp04...

0 new messages