It gets much more complicated to attempt this from within the preview. I can't post all my code here on the UT .. it involves more than one class and an Extention Handler that all works together. The native behavior of hitting the print button is to close the preview and print the report. I had to wrap the entire process in code that calls the preview .. lets them prompt for pages .. sets some properties .. exits the preview which in turn prints the report using my properties. Then I restarted the preview where it left off.
I'm guessing what you need to do is put code in the IncludePageInOutput method. When you are previewing, the array or property you use should be blank and you should just DODEFAULT(). When the array or property is filled in, check to see if the page matches. In your code that gets the pages from the user .. all you should have to do is set the property or array .. then close down the preview container. There is a property, but I can't remember what it's called, that indicates whether it should print when it closes down. Use intellisense to find it and make sure it's set to .t. The printing should happen automatically at that point as the preview container is closed.