Dialogs

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I wish to diable the print capability on the
Application.Dialogs(xlDialogPrintPreview).Show command. That is I just want
them to see the form and not be able to print it at this time.
(Office 2003)
I appreciate all the help. Thanks.
OlieH
 
There is no way to change the print preview dialog. What you can do is to
handle the print event however. Set up a global variable and check it in the
before print event... something like this

Public NOT_OK_TO_PRINT as boolean 'False by default

sub whatever()
NOT_OK_TO_PRINT = true
Application.Dialogs(xlDialogPrintPreview).Show
NOT_OK_TO_PRINT = False
end sub

In thisworkbook module
Private Sub Workbook_BeforePrint(Cancel As Boolean)
if NOT_OK_TO_PRINT then cancel = true
End Sub

The above code is untested but it should be close to what you want...
 
Jim, thanks for the help. I must be missing something. After declaring
"NOT_OK,..", I entered the Private sub code and then tried to execuite the
NOT OK set code and tried the dialogs(xldialogprintpreview).show code.
However the system still allowed me to print the form. What am I missing?
Again, I really appreciate your help.
 
The cancel print works but I do want the operator to PREVIEW the page just
not be able to print it. Any suggestions. Thanks for the help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top