I am having trouble printing multiple copies of an output where g.copies is always 1.

I went to the examples and made the following change for g.nextpage but as copies is always 1 the loop doesn't work.

I'm using - 2108 R2

Dim g As Graphics

Dim p As PrinterSetup

p = New PrinterSetup

If p.PageSetupDialog Then

g = OpenPrinterDialog(p)

If g <> Nil Then

for i as integer = 1 to g.Copies

Dim hDPI As Double = p.HorizontalResolution

Dim vDPI As Double = p.VerticalResolution

Dim pageWidth As Double = p.PageWidth

Dim pageHeight As Double = p.PageHeight

g.TextFont = "Arial"

g.TextSize = 9

// Width and height of label in inches

Dim labelWidth As Double = WidthField.Text.Val

Dim labelHeight As Double = HeightField.Text.Val

// Width and height of label in page points

Dim labelPageWidth As Double = hDPI * labelWidth

Dim labelPageHeight As Double = vDPI * labelHeight

// Draw as many labels as fit into the size of the page

For x As Integer = 1 To pageWidth Step labelPageWidth

For y As Integer = 1 To pageHeight Step labelPageHeight

If (y + labelPageHeight) < pageHeight And _

(x + labelPageWidth) < pageWidth Then

g.DrawString(LabelArea.Text, x, y)

End If

Next

Next

if g.Copies > 1 then

g.NextPage

end if

next i

End If

End If