Solved

Printer Common Dialog/Flags

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
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 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…

705 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

17 Experts available now in Live!

Get 1:1 Help Now