I am using the Printer.Page in my code. The problem is it is keeping it's value between runs! Here is the code. You can see the use of Page to check whether it's the first page or not. I run this code, stop the application, and run it from the IDE, and I find Page has kept it's value!!!
nolabelsacross = Text1 'in
nolabelsdown = Text2 'in
LabelsPerPage = nolabelsacross * nolabelsdown
NoLabels = UBound(m_Labels)
sheetHLS = HLS
sheetVLS = VLS
'Printer.KillDoc
Dim x As Printer
For i = 1 To NoLabels
'new page?
partpage = (i - 1) Mod LabelsPerPage
If partpage = 0 And Printer.Page <> 1 Then 'start of new page
Printer.NewPage
End If
'get page itemno
itemno = i - ((Printer.Page - 1) * LabelsPerPage)
'get Row No. for Label
CompleteRows = itemno \ nolabelsacross
PartRows = itemno Mod nolabelsacross
If PartRows > 0 Then ' round up part
RowNo = CompleteRows + 1
Else
RowNo = CompleteRows ' this is end of row
End If
'get Column No. for item
PartRow = itemno Mod nolabelsacross
If PartRow = 0 Then 'end
ColNo = nolabelsacross
Else
ColNo = PartRow
End If
lblx = LabelX(ColNo, sheetHLS)
lbly = LabelY(RowNo, sheetVLS)
Printer.CurrentX = lblx
Printer.CurrentY = lbly
Printer.Print m_Labels(i)
Next
Printer.EndDoc
nolabelsacross = Text1 'in
nolabelsdown = Text2 'in
LabelsPerPage = nolabelsacross * nolabelsdown
NoLabels = UBound(m_Labels)
sheetHLS = HLS
sheetVLS = VLS
'Printer.KillDoc
Dim x As Printer
For i = 1 To NoLabels
'new page?
partpage = (i - 1) Mod LabelsPerPage
If partpage = 0 And Printer.Page <> 1 Then 'start of new page
Printer.NewPage
End If
'get page itemno
itemno = i - ((Printer.Page - 1) * LabelsPerPage)
'get Row No. for Label
CompleteRows = itemno \ nolabelsacross
PartRows = itemno Mod nolabelsacross
If PartRows > 0 Then ' round up part
RowNo = CompleteRows + 1
Else
RowNo = CompleteRows ' this is end of row
End If
'get Column No. for item
PartRow = itemno Mod nolabelsacross
If PartRow = 0 Then 'end
ColNo = nolabelsacross
Else
ColNo = PartRow
End If
lblx = LabelX(ColNo, sheetHLS)
lbly = LabelY(RowNo, sheetVLS)
Printer.CurrentX = lblx
Printer.CurrentY = lbly
Printer.Print m_Labels(i)
Next
Printer.EndDoc