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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PRINT title in center on hight page for each page

2009luca

Programmer
Jul 27, 2013
231
IT
Rich (BB code):
Private Sub Image17_Click()

    If Val(Me.LNRC.Caption) > 0 Then

        Screen.MousePointer = vbHourglass
        
        With Me.MSFlexGrid6
  
            Printer.Font = "Consolas"
            Printer.Font.Size = 9
            
            'THIS IS THE TITLE
            Printer.Print vbCrLf
            Printer.Print "                                PREVISIONI DEL LOTO " & vbCrLf & "    _______________________________________________________________________"
             'THIS IS THE TITLE
            
            For I = 1 To Val(Me.LNRC.Caption) - 1
                 'Left(.TextMatrix(I, 0) & Space(11), 11)
                Printer.Print "    " & Left(.TextMatrix(I, 0) & Space(9), 9) & "  " & .TextMatrix(I, 1) & "  " & Format(.TextMatrix(I, 2), "DD/MM/YYYY") & "  " & Format(.TextMatrix(I, 3), "#00") & "  " & Format(.TextMatrix(I, 4), "#00") & "  " & Format(.TextMatrix(I, 5), "#00") & "  " & Format(.TextMatrix(I, 6), "#00") & "  " & Format(.TextMatrix(I, 7), "#00") & "  " & Format(.TextMatrix(I, 8), "#00") & "  " & Format(.TextMatrix(I, 9), "#00") & "  " & Format(.TextMatrix(I, 10), "#00") & "  " & Format(.TextMatrix(I, 11), "#00") & "  " & Format(.TextMatrix(I, 12), "#00") & "  " & Format(.TextMatrix(I, 13), "#00")
            Next I

        End With

        Printer.EndDoc

        Screen.MousePointer = vbDefault

    Else

        Beep
        Me.LAZIONI.Caption = "PROSPETTO VUOTO!"
        DoEvents
        Sleep (1500)
        Me.LAZIONI.Caption = ""

    End If

End Sub

OK, but i need to print the title on each page if the number of pages are more than one...
 
Is the problem printing the title centred (which you seem to be doing, albeit in a clumsy and inefficient way)? Or is it figuring out how to know if you are printing more than one page?
 

Part and Inventory Search

Sponsor

Back
Top