| TVP Print full macro |
|
mForms Module (Contains TVP Print Subroutine): Public Sub TvpPrint() mPrint.GetBinNumbers mPrint Module (Contains GetBinNumbers & GetBinNames Functions and OnePlusOne, SingleHeaded, InsertDate and Test Subroutines):
Option Explicit Private Declare Function DeviceCapabilities Lib "winspool.drv" _ Public Function GetBinNumbers() As Variant 'Get the printer & port name of the current printer 'Set the array of bin numbers to the right size 'Load the array with the bin numbers iBins = DeviceCapabilities(sCurrentPrinter, sPort, _ PrinterInfo.ListBox1.List = GetBinNumbers PrinterModel = "not set up for use with this function." 'Default value for any printers not recognised below If traytype = 283 Then PrinterModel = "an OKI 20/24" 'Note that STANDARD applies to HP4100 Printer and other printers that use Word constants 'Set up trays for Oki 20/24 'Set up trays for HP4200tn 'Set up trays using Word default values for unrecognised/unsuitable printers frmPrint.Label1 = PrinterModel Public Function GetBinNames() As Variant 'Code adapted from Microsoft KB article Q194789 'Get the printer & port name of the current printer 'Find out how many printer bins there are 'Set the string to the right size to hold all the bin names 'Load the string with the bin names 'Set the array of bin names to the right size 'Return the array to the calling routine Dim trayh As String copies = frmPrint.CopiesBox.Text 'current tray setting Do Until copynum = 0 'headed copy With ActiveDocument.PageSetup ActiveDocument.PrintOut With ActiveDocument.PageSetup End Sub Public Sub SingleHeaded() Dim trayh As String 'current tray setting 'headed copy Public Sub Insertdate() Public Sub Test() mShortcutnocopy Module (contains CTRLALTP subroutine): Sub CTRLALTP() mShortcutwcopy Module (contains CTRLSHIFTP subroutine):
Sub CTRLSHIFTP() ' Macro created 21/08/2003 by D Savery Version Module (contains version subroutine): Sub Version() PrinterInfo Form (activated when the About button is pressed): Private Sub ListBox1_Click() Private Sub ListBox2_Click() Private Sub CmdOk_Click() The layout of the printer Info Form frmprint Form (activated by TVP Print macro): Private Sub CmdAbout_Click() Private Sub CmdCancel_Click() Private Sub CmdOk_Click() 'Set print trays for 1+1 'Set print trays for single headed If OptHed.Value = True Then 'Enter todays date Unload Me Private Sub CopiesBox_Change() Private Sub Label2_Click() Private Sub Label3_Click() Private Sub UserForm_Click() The frmprint UserForm dialogue box |