Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Finding the properties of the VB Print Common Dialog Box

Posted on 2001-08-07
4
Medium Priority
?
505 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 300 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
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…

721 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