Solved

Finding the properties of the VB Print Common Dialog Box

Posted on 2001-08-07
4
467 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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 Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

776 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