#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Dialogs

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Dialogs

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...
--
HTH...

Jim Thomlinson


"OlieH" wrote:

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Dialogs

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.

"Jim Thomlinson" wrote:

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...
--
HTH...

Jim Thomlinson


"OlieH" wrote:

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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 39
Default Dialogs

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.


"OlieH" wrote:

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.

"Jim Thomlinson" wrote:

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...
--
HTH...

Jim Thomlinson


"OlieH" wrote:

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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
dialogs Damien Excel Programming 2 March 7th 07 09:36 PM
dialogs Damien Excel Programming 0 March 7th 07 05:35 AM
The Dialogs collection James Butler Excel Programming 2 May 3rd 05 02:39 AM
Dialogs nc Excel Discussion (Misc queries) 1 March 23rd 05 02:17 PM
Dialogs Command Stratuser Excel Programming 0 February 12th 04 03:43 PM


All times are GMT +1. The time now is 03:40 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"