Print doesn't Print

Print doesn't Print

Post by Frank Curti » Wed, 10 Jul 2002 07:21:16



Here is a snippet of my code. The code will not print from my HP printer,
unless I go into the print dialog box that pops up, change something under
the properties (and change it back) and then it prints fine. Otherwise it
exits. I dont have to do this for the second page. And the second page will
not try to print if the first one fails, so the sub must be bailing to the
ErrHAndler routine.

Private Sub cmdPrint_Click()
    Dim beginpage, endpage, numcopies, i

    cmdPrint.Visible = False
    cmdCancel.Visible = False

    MsgBox ("First Print: Employer's Copy")

    CommonDialog1.CancelError = True
    On Error GoTo errhandler
    CommonDialog1.ShowPrinter
    beginpage = CommonDialog1.FromPage
    endpage = CommonDialog1.ToPage
    numcopies = CommonDialog1.Copies
    For i = 1 To numcopies
    frmRemit.PrintForm
    Next

( cut out where I change visible parameters here)

MsgBox ("Second Print: Employee's Copy")
    CommonDialog1.CancelError = True
    On Error GoTo errhandler
    CommonDialog1.ShowPrinter
    beginpage = CommonDialog1.FromPage
    endpage = CommonDialog1.ToPage
    numcopies = CommonDialog1.Copies
    For i = 1 To numcopies
    frmRemit.PrintForm
    Next

    [cut]

 
 
 

Print doesn't Print

Post by xcgv » Sat, 13 Jul 2002 20:05:27


have u tried printer.enddoc

otherwise the printing just spools

Quote:> Here is a snippet of my code. The code will not print from my HP printer,
> unless I go into the print dialog box that pops up, change something under
> the properties (and change it back) and then it prints fine. Otherwise it
> exits. I dont have to do this for the second page. And the second page
will
> not try to print if the first one fails, so the sub must be bailing to the
> ErrHAndler routine.

> Private Sub cmdPrint_Click()
>     Dim beginpage, endpage, numcopies, i

>     cmdPrint.Visible = False
>     cmdCancel.Visible = False

>     MsgBox ("First Print: Employer's Copy")

>     CommonDialog1.CancelError = True
>     On Error GoTo errhandler
>     CommonDialog1.ShowPrinter
>     beginpage = CommonDialog1.FromPage
>     endpage = CommonDialog1.ToPage
>     numcopies = CommonDialog1.Copies
>     For i = 1 To numcopies
>     frmRemit.PrintForm
>     Next

> ( cut out where I change visible parameters here)

> MsgBox ("Second Print: Employee's Copy")
>     CommonDialog1.CancelError = True
>     On Error GoTo errhandler
>     CommonDialog1.ShowPrinter
>     beginpage = CommonDialog1.FromPage
>     endpage = CommonDialog1.ToPage
>     numcopies = CommonDialog1.Copies
>     For i = 1 To numcopies
>     frmRemit.PrintForm
>     Next

>     [cut]


 
 
 

1. Printing a window's bitmap (simulating Alt+PrintScrn followed by a paste then print)

Yes.  You will need a DIB.  You will use GetDIBits to transfer from
the screen to the DIB, then StretchDIBits to transfer from the DIB to
the printer.  The reason that StretchBlt doesn't work is that the
respective driver provides meaning to the format of the memory used
for its device surface.  Display surfaces have a different format that
printers.  Indeed, this is part of the motivation for the DIB; it is
device-independent.  If it were me, I would probably create a 24bpp
DIB and avoid color table anoyances when blitting, otherwise you'll
have to set up a palette too.

I see no water here.

2. Calling Start viles via relative paths

3. Replacement Gina : Logon Event is Not shown by event viewer

4. SetTextCharacterExtra doesn't have effect in printing

5. Setting up sendmail for smtp only ...

6. GetComm../Printing doesn't under NT

7. Initalization order.

8. HELP: my print routine doesn't work with picfax.drv

9. "TPrinter->Print" doesn't work properly !?

10. Text displays fine, doesn't print!

11. GDI-Fontsize doesn't print correctly

12. Printing in Windows 95 but the NewPage doesn't work