Solved

Printer Common Dialog/Flags

Posted on 1997-08-25
1
345 Views
Last Modified: 2006-11-17
How do you use the constants (ex. cdlPDAllPages, cdlPDPageNums) to return the value of the print common dialog box after the user presses OK? I need to know whether the user has selected All Pages, a page range, or just a selection, etc.
0
Comment
Question by:Raven76
1 Comment
 
LVL 3

Accepted Solution

by:
ChrisLewis earned 50 total points
ID: 1432191
It's simple,

After calling CommonDialog1.ShowPrinter, get the properties of the CommonDialog1 control:

CommonDialog1.ShowPrinter      ' display Printer common dialog box.
iCopies= CommonDialog1.Copies
ifrom = CommonDialog1.FromPage
iTo = CommonDialog1.ToPage

To get the values of the Flag property, use a bitwise and to read the state of the option button.

CommonDialog1.Flags = cdlPDAllPages Or cdlPDSelection
CommonDialog1.ShowPrinter
If CommonDialog1.Flags And cdlPDSelection Then
  MsgBox "Selection"
Else
  MsgBox "All Pages"
End If


Hope this helps

Chris
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no 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 …
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…
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…

863 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

20 Experts available now in Live!

Get 1:1 Help Now