Solved

Finding the properties of the VB Print Common Dialog Box

Posted on 2001-08-07
4
473 Views
Last Modified: 2008-02-01
I am using VB6.0 with Windows 2000 operating system.  

Need your help in finding the variable names of the VB print common dialog box.  I need to extract the values from the Layout tab screen(Orientation, Duplex printing, Page Order, and pages per sheet combobox) and the Paper/Quality tab screen (Paper/Output: Paper Size.)

  You can display the common dialog box by using the following code:
    CommonDialog1.showprinter

AFter finding the variables holding values in the Common Dialog Box, I then need to know what variables they are updating to the VB System.

If you have any information for this problem, please let me know, even if you only have some of the information.


Kind of desperate at this point.  Thanks a whole lot.

BirdsOfFire
0
Comment
Question by:BirdsOfFire1
  • 2
4 Comments
 
LVL 22

Expert Comment

by:rspahitz
ID: 6360204
You need to check the properties of the printer object based on the printer selected by the user of the dialog box.

Once the printer is selected, find the selected printer and check:

Printer.Orientation
Printer.Duplex
etc.
0
 
LVL 17

Accepted Solution

by:
inthedark earned 100 total points
ID: 6360269
If you are using common dialog control you may need to set:

printer.trackdefault=true

Before you use the showprinter method.

Also suggest if you do a lot of work with the printer to put the following link in your browser favorites.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vb98/dt_vbobjPrinter_P.asp

Hope this helps.
0
 

Author Comment

by:BirdsOfFire1
ID: 6365842
To: inthedark
    rspahitz

Thanks for answering my request.  

What I am trying to do is to extract the values from the vb common dialog print box.  The values will then be used to feed the CRViewer printer commands.

This eliminates the use of the Crystal Reports print box.  I can use the Crystal Reports print box, but I have to used a second print box, if needed, to cancel the report.

The link "http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vb98/dt_vbobjPrinter_P.asp" you suggested gives information about the VB print properties but not the VB common dialog print box.

Is there any other way to extract the values from the VB common dialog print box?

Your help is appreciated!  BirdsOfFire.  
0
 
LVL 22

Expert Comment

by:rspahitz
ID: 6366056
The common dialog control, as you know, supports showing a "select printer" dialog box.

When the user selects a printer, the information is placed in various properties of the control.

For example (assuming control is named cdl1):

...
  debug.print cdl1.copies ' prints 1
  debug.print cdl1.FromPage ' prints 0
  debug.print cdl1.Orientation ' prints 1
  debug.print cdl1.PrinterDefault ' prints True
  debug.print cdl1.ToPage ' prints 0

  cdl1.ShowPrinter

' These print the values selected by the user
  debug.print cdl1.copies
  debug.print cdl1.FromPage
  debug.print cdl1.Orientation
  debug.print cdl1.PrinterDefault
  debug.print cdl1.ToPage
...

' All other values must be captured from the selected printer.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Question about INSTR  - need to extract data MS ACCESS query 6 59
Add and format columns in vb6 7 63
Macro Excel - Multiple If conditions 2 81
Automatic Email Reminder 4 58
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question