?
Solved

Printer Common Dialog/Flags

Posted on 1997-08-25
1
Medium Priority
?
377 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 200 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

Technology Partners: 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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
Suggested Courses

762 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