Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements.
To resolve this behavior, the
Max property of the
CommonDialog control needs to be set to a value
greater than 0, and greater than the value of the control's
Min property.
To enable the
Pages option button, follow these steps:
1. | Follow steps 1 through 6 of the "Steps to Reproduce Behavior" section later in this article.
|
2. | Set the On Click property for the command button to the following event procedure:
Private Sub Command1_Click()
Dim cd As CommonDialog
Set cd = Me!CmnDlg.Object
With cd
.Flags = cdlPDPageNums
' Allow a page range of 1 - 50 to be entered in
' the dialog box.
.Min = 1
.Max = 50
' Default the From box to 1, and the To box to 50.
' Note that the FromPage property must be greater than or
' equal to the Min property, and the ToPage property
' must be less than or equal to the Max property.
.FromPage = 1
.ToPage = 50
.ShowPrinter
End With
End Sub
|
3. | On the View menu, click Form View.
|
4. | Click the command button. |
Note that the
Pages option button and associated edit controls are enabled, and the page range is set from 1 to 50 by default.