Epson C31C213A8941 Print Driver Guide - Page 38

Controlling the Printer from Visual Basic Ver. 4.0

Page 38 highlights

6.2. Controlling the Printer from Visual Basic (Ver. 4.0) This section shows how you can control the TM printer using Visual Basic (version 4.0). Note that the TM printer drivers include sample Visual Basic programs that provide additional examples. 6.2.1. Selecting the Printer Driver The following code establishes the specified printer driver as your "default printer." 'Setthe specified printer driver as the "defaultprinter." ForE ach prnPrinterIn Printers IfprnPrinter.D eviceN am e = "E PSO N TM -300A N o cut"Then SetPrinter= prnPrinter E xitFor E nd If N ext 6.2.2. Selecting the Paper Source Use the following code to set or change the paper source when printing out text. 'Selecting the paper source. Printer.FontSize = 10 Printer.FontN am e = "control" P rinter.P rint "3" 'E nter and printtext. Printer.FontSize = 10 Printer.FontN am e = "20 cpi" P rinter.P rint "test print" 'Setup the controlfont. ' 'E nter the special-function corresponding to the desired source. '1:Journal '2:R eceipt '3:B oth 'Selectthe textfontsize. 'Selectthe textfont. 'E nter and printthe textstring. TITLE EPSON TM Printer Driver User's Manual SHEET REVISION 1.61 NO NEXT 39 SHEET 38

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45

TITLE
TM Printer Driver
SHEET
REVISION
NO
User's Manual
1.61
NEXT
39
SHEET
38
EPSON
6.2. Controlling the Printer from Visual Basic (Ver. 4.0)
This section shows how you can control the TM printer using Visual Basic (version 4.0). Note that the TM printer drivers
include sample Visual Basic programs that provide additional examples.
6.2.1. Selecting the Printer Driver
The following code establishes the specified printer driver as your "default printer."
6.2.2. Selecting the Paper Source
Use the following code to set or change the paper source when printing out text.
'Setthe specified printer driver as the "defaultprinter."
For Each prnPrinter In Printers
IfprnPrinter.DeviceN am e = “EPSON TM -300A N o cut”Then
SetPrinter = prnPrinter
ExitFor
End If
N ext
'Selecting the paper source.
Printer.FontSize = 10
'Setup the controlfont.
Printer.FontN am e = "control"
'
Printer.Print“3”
'Enter the special-function
corresponding to the desired
source.
' 1:Journal
' 2:Receipt
' 3:Both
'Enter and printtext.
Printer.FontSize = 10
'Selectthe textfontsize.
Printer.FontN am e = "20 cpi"
'Selectthe textfont.
Printer.Print“testprint”
'Enter and printthe textstring.