Solved

Finding the properties of the VB Print Common Dialog Box

Posted on 2001-08-07
4
490 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…
Suggested Courses
Course of the Month9 days, 19 hours left to enroll

624 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