Advanced Question: How to "Gray out" Print Preview Button


Posted by Rick on November 07, 2001 10:09 AM

I am opening the Windows print dialog box using code:

Application.Dialogs(xlDialogPrint).Show

I need to disable the Preview button on this dialog box. Help tells me that "preview" is the 6th augument. What code do I add to disable this button.

Please, only answer if you know for sure.

Thanks

Posted by Joe Was on November 07, 2001 12:18 PM

This will Deactivate the "Preview" Property and show the print box.

Application.Dialogs(xlDialogPrint).Show (preview = False)

The Print Dialog Box will open the preview button will be visible and appear to be active but if the user clicks it nothing will happen.

You may try to set the button font color to gray by trapping the color index or use the xlDialogPushButtonProperties with one of the xlEditColor type Dialogs on the preview property?

I tested the "preview property" and it works when set to False in Excel 2000 but did not try the color reset, as the above code did turn off the preview button. Joe Was



Posted by Joe Was on November 07, 2001 12:18 PM

This will Deactivate the "Preview" Property and show the print box.

Application.Dialogs(xlDialogPrint).Show (preview = False)

The Print Dialog Box will open the preview button will be visible and appear to be active but if the user clicks it nothing will happen.

You may try to set the button font color to gray by trapping the color index or use the xlDialogPushButtonProperties with one of the xlEditColor type Dialogs on the preview property?

I tested the "preview property" and it works when set to False in Excel 2000 but did not try the color reset, as the above code did turn off the preview button. Joe Was