• Visual Basic – Using the Print function

    Home » Forums » AskWoody support » Productivity software by function » Visual Basic for Applications » Visual Basic – Using the Print function

    • This topic has 1 reply, 1 voice, and was last updated 1 year ago.

    I have a data sheet that prints out.

    I now want to print a pair of data sheets

    Calculated values for items to be stored in array Val(30,1)

    Values for Item 1 go into Val(x,0)

    Values for Item 2 go into Val(x,1)

    Sub PrintDocument1_PrintPage(sender As System.Object, e As PrintPageEventArgs) Handles PrintDocument1.PrintPage

    has code like:

    e.Graphics.DrawString(“Number of Teeth. = ” & Val(0, a), printfont, Brushes.Black, 10, 90)

    I want to loop through the print function using Val(x,0) and then cause a new page and then loop through again using Val(x,1)

    How should the code be set up to do it?

    Private Sub cmdPrint_Click(sender As Object, e As EventArgs) Handles cmdPrint.Click

    PrintDocument1.PrinterSettings.Copies = 1


    Viewing 0 reply threads
    Viewing 0 reply threads
    Reply To: Visual Basic – Using the Print function

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: