This example displays the next page in a multipage file, and determines whether there is another page to display.
Private Sub cmdNextPage_Click()
Dim lngNewPg As Long
lngNewPg = ImgEdit1.Page + 1
'Determine if there is a next page to be displayed
'by finding out the number of pages in the file
If lngNewPg > ImgEdit1.PageCount Then
MsgBox "Page Number is out of range"
'Don't set page property
Exit Sub
End If
ImgEdit1.Page = lngNewPg
ImgEdit1.Display
End Sub