Consulting

Results 1 to 5 of 5

Thread: Printing restriction

  1. #1
    VBAX Tutor
    Joined
    Jul 2016
    Posts
    264
    Location

    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

  2. #2
    Microsoft Word MVP 2003-2009 VBAX Guru gmaxey's Avatar
    Joined
    Sep 2005
    Posts
    3,118
    Location
    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
    Greg

    Visit my website: http://gregmaxey.com

  3. #3
    VBAX Tutor
    Joined
    Jul 2016
    Posts
    264
    Location
    How do I link these subs to a "print command button?

  4. #4
    Microsoft Word MVP 2003-2009 VBAX Guru gmaxey's Avatar
    Joined
    Sep 2005
    Posts
    3,118
    Location
    In your print command button code, call:

    HideCmdButtons
    'whatever other code you have
    ShowCmdButtons
    Greg

    Visit my website: http://gregmaxey.com

  5. #5
    VBAX Tutor
    Joined
    Jul 2016
    Posts
    264
    Location
    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
  •