|
Public Function CheckForNewPage(sSpaceNeeded As Single, Optional LeftSet As Single, Optional TopSet As Single, Optional PageNo As Long) As Boolean
On Error Goto ErrorHandler Dim sFontSize As Single With Printer If sSpaceNeeded > ((.Height / 1440) - 0.25) Then sFontSize = .FontSize .FontSize = 6 PrintPageNo PageNo .NewPage .CurrentX = 0.5 .CurrentY = 0.5 Printer.Print "(Cont.)" If LeftSet = 0 Then .CurrentX = 1 Else .CurrentX = LeftSet If TopSet = 0 Then .CurrentY = 0.7 Else .CurrentY = TopSet .FontSize = sFontSize CheckForNewPage = True End If End With Exit Function ErrorHandler: MsgBox Error & vbCr & " NewPage" End Function |