Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printer Select Dialog Form -- Part 4

What VB shoud be able to do!

Printer Select Dialog Form -- Part 4

by  CassandraR  Posted    (Edited  )
Save as clsPrintSelec.cls
Code:
VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "clsPrintSelect"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Option Explicit
'
'----------------------------------------------------------------------------------------
'   INTERNAL GENERAL VARIABLES
'----------------------------------------------------------------------------------------
'
Private m_intErrorNumber As Integer     ' Storage for Error Number
Private m_strErrorDescr As String       ' Storage for Error Description string
'
Private m_prtSelectedPrinter As Printer ' Printer that the user has selected.
Private m_intPaperSize As Integer       ' Selected papersize from dialog box.
Private m_intPaperSource As Integer     ' Selected papersource from dialog box.
'

'
'----------------------------------------------------------------------------------------
'   PROPERTY ROUTINES
'----------------------------------------------------------------------------------------
'
Friend Property Set SelectedPrinter(ByRef prtNewPrinter As Printer)
    If IsNull(prtNewPrinter) Then Exit Property
    If prtNewPrinter Is Nothing Then Exit Property
    Set m_prtSelectedPrinter = prtNewPrinter
End Property
'
'----------------------------------------------------------------------------------------
'

Public Property Get PrinterSelected() As Object ' Printer
    Set PrinterSelected = m_prtSelectedPrinter
End Property
'
'----------------------------------------------------------------------------------------
'

'
'----------------------------------------------------------------------------------------
'   PUBLIC INTEFACE ROUTINES
'----------------------------------------------------------------------------------------
'
Public Sub PrinterSelect()
    frmPrinterSelect.Show vbModal
    Set m_prtSelectedPrinter = frmPrinterSelect.SelectedPrinter
End Sub
'
' ---------------------------------------------------------------------------------------
'

'
'----------------------------------------------------------------------------------------
'   INTERNAL ROUTINES
'----------------------------------------------------------------------------------------
'
Private Sub Class_Initialize()
        Set frmPrinterSelect.PrintSelectCls = Me
End Sub
'
' ---------------------------------------------------------------------------------------
'
End of clsPrintSelec.cls
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top