From: WatsonR@IntelligenCIA.com   
      
   "D Wigg" wrote in message   
   news:nujOe.11071$5m3.470@fe1.news.blueyonder.co.uk...   
   > Hello all,   
   >   
   > I'm using VB6.0 to write an application which prints a report. The problem   
   I   
   > have occurs when I try to allow the user to select the number of copies   
   and   
   > which pages to print.   
   >   
   > Using the code below doesn't show the printer box to allow the selections   
   to   
   > be made but printing happens anyway.   
   >   
   > The PrintRoutine subroutine (not shown) is copied from the MS knowledge   
   base   
   > allowing printing to a printer or to a print preview form by passing the   
   > appropriate parameter. (The print preview works fine, but doesn't use a   
   > CommonDialog call anyway.)   
   > I don't think the problem lies in the print routine as it isn't called   
   till   
   > later anyway.   
   >   
   > I use other CommonDialog functions elsewhere in the programme to select   
   > files from a directory without any problems. Just can't see what I'm doing   
   > wrong, or not doing at all.   
   >   
   > Suggestions please......   
   >   
   > TIA,   
   > Dave   
   >   
   ____________________________________________________________________________   
   ______   
   > Code snippet follows:   
   >   
   > CommonDialog1.Action = 5   
   > CommonDialog1.ShowPrinter   
   >   
   > ' Get user selected values   
   >   
   > BeginPage = CommonDialog1.FromPage   
   > EndPage = CommonDialog1.ToPage   
   > Numcopies = CommonDialog1.Copies   
   >   
   > ' Code to use start and finish pages and no. of copies to be added later   
   >   
   > PrintRoutine Printer   
   > Printer.EndDoc   
   >   
      
   You may want to try different FLAGS setting priort to calling the printer   
   dialog.   
   however, the print dialog behavior has lots to do with the way it's handled   
   by the printer driver.   
   Hundreds of drivers generates hundreds of print dialogs, each with its own   
   quircks.   
   For example, my code can set the page range on the Epson but on the HP   
   Deskjet dialog,   
   regardless what flag setting I set, I am unable to ungray the "Pages"   
   option.   
      
   May want to try Win API directly.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|