Solved

Printer Common Dialog/Flags

Posted on 1997-08-25
1
367 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
[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
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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
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…

691 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