Solved

Finding the properties of the VB Print Common Dialog Box

Posted on 2001-08-07
4
453 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now