-
Printing restriction
I have a locked form that has 3 buttons (I do have the password)
1. does a spell check within text boxes.
2. adds a row to a table
3. Also adds a row to a table
I don't want the buttons to print.
I have looked all over for an answer to this.
Any help or guidance is appreciated.
Last edited by Kilroy; 02-02-2017 at 02:37 PM.
Reason: additional information
-
Sub PrintPreviewAndPrint()
HideCmdButtons
Application.ScreenRefresh
Dialogs(wdDialogFilePrint).Show
ShowCmdButtons
End Sub
Sub FilePrintDefault()
HideCmdButtons
ActiveDocument.PrintOut
ShowCmdButtons
End Sub
Private Sub HideCmdButtons()
Dim oButton As InlineShape
For Each oButton In ActiveDocument.InlineShapes
If oButton.Type = wdInlineShapeOLEControlObject Then
With oButton.PictureFormat
'.Brightness = 1
'.Contrast = 0
End With
End If
Next
End Sub
Private Sub ShowCmdButtons()
Dim oButton As InlineShape
For Each oButton In ActiveDocument.InlineShapes
If oButton.Type = wdInlineShapeOLEControlObject Then
With oButton.PictureFormat
.Brightness = 0.5
.Contrast = 0.5
End With
End If
Next
End Sub
-
How do I link these subs to a "print command button?
-
In your print command button code, call:
HideCmdButtons
'whatever other code you have
ShowCmdButtons
-
Thanks Greg. Works great.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules