Disabling the page range on the Print Dialog 
Author Message
 Disabling the page range on the Print Dialog

I'm filling the page range with a set of page numbers which I want to
prevent being changed. I need to show this dialog as the user needs access
to the printer properties.

I am looking for a way to disable either the page range frame, or the option
buttons and page range text box.

My code is as follows:

    Set dlg = Dialogs(wdDialogFilePrint)
    With dlg
        .Range = wdPrintRangeOfPages
        .Pages = strPages
        .Show
    End With

Thanks.



Mon, 22 Jul 2002 03:00:00 GMT  
 Disabling the page range on the Print Dialog
Hi Ian,

| I'm filling the page range with a set of page numbers which I want to
| prevent being changed. I need to show this dialog as the user needs access
| to the printer properties.
|
| I am looking for a way to disable either the page range frame, or the
option
| buttons and page range text box.

You cannot "disable" the controls on an inbuilt dialog but you can limit the
users ability to change the settings. Try the following. It checks to see
whether the user has changed the page range - if s\he has, a msgbox is
displayed to inform them that this is not allowed and the dialog is shown
again.

-----------------------------------------------------------

Do
    With Dialogs(wdDialogFilePrint)

        .Range = wdPrintRangeOfPages
        .Pages = strPages

        If .Display = -1 Then
            If .Pages = strPages Then
                .Execute
                Exit Do
            Else
                MsgBox "You are not allowed to" & _
                "change the Page Range."
            End If
        Else
            Exit Do
        End If

    End With
Loop

---------------------------------------------------------

Hope this helps.
Regards
ibby

Please post any replies to the **newsgroup** so that others in the newsgroup
may contribute or benefit.



Tue, 23 Jul 2002 03:00:00 GMT  
 Disabling the page range on the Print Dialog
Thanks ibby, a good alternative method which worked well !

Quote:

> You cannot "disable" the controls on an inbuilt dialog but you can limit
the
> users ability to change the settings. Try the following. It checks to see
> whether the user has changed the page range - if s\he has, a msgbox is
> displayed to inform them that this is not allowed and the dialog is shown
> again.

> -----------------------------------------------------------

> Do
>     With Dialogs(wdDialogFilePrint)

>         .Range = wdPrintRangeOfPages
>         .Pages = strPages

>         If .Display = -1 Then
>             If .Pages = strPages Then
>                 .Execute
>                 Exit Do
>             Else
>                 MsgBox "You are not allowed to" & _
>                 "change the Page Range."
>             End If
>         Else
>             Exit Do
>         End If

>     End With
> Loop

> ---------------------------------------------------------

> Hope this helps.
> Regards
> ibby

> Please post any replies to the **newsgroup** so that others in the
newsgroup
> may contribute or benefit.



Tue, 23 Jul 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Printer Page Range Always Disabled

2. Common Dialog Printer How To Page Range

3. Printing Specific or Range of Pages

4. Print Page Range Question

5. Programmatically Printing a Range of pages.

6. ComonDialog print page range

7. printing page ranges?

8. Printing out a range of pages in WebBrowser control

9. printing a selsct range of pages

10. printing a range of pages

11. Very simple Range question - beggining the range on 3rd page onwards

12. Disabling print dialog box - the hard way

 

 
Powered by phpBB® Forum Software