469,927 Members | 1,627 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,927 developers. It's quick & easy.

Showing printer with CommonDialog

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

Aug 22 '05 #1
1 12340

"D Wigg" <dn****@blueyonder.co.uk> wrote in message
news:nu*****************@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.
Aug 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Patrick Herb | last post: by
1 post views Thread by Norbert Staiger | last post: by
2 posts views Thread by Patrick Blackman | last post: by
1 post views Thread by Simon | last post: by
3 posts views Thread by Michael C# | last post: by
25 posts views Thread by yanivoliver | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.