Consulting

Results 1 to 3 of 3

Thread: Restrict printing unless field occupied

  1. #1

    Question Restrict printing unless field occupied

    I have a word document I send out as a template. No matter what I've tried, highlighting the blanks, sending an accompanying check list, I cannot get everyone to properly fill in, or even look at, all the fields that need to be occupied.

    My question is, is there a way to keep the document from printing unless certain fields(currently using Content Controls) are filled in.

    Also, Whenever they save this document that is properly filled in, is there a way to automatically change the properties of the saved document to not be able to be duplicated.


    Thanks in advance, you guys are the best!
    Donny

  2. #2
    Microsoft Word MVP 2003-2009 VBAX Guru gmaxey's Avatar
    Joined
    Sep 2005
    Posts
    3,340
    Location
    For the first question something along these lines:

    [VBA]Option Explicit
    Sub FileSave()
    On Error Resume Next
    If Validate Then ActiveDocument.Save
    End Sub
    Sub FileSaveAs()
    If Validate Then ActiveDocument.SaveAs
    End Sub
    Sub FilePrint()
    If Validate Then ActiveDocument.PrintOut
    End Sub
    Function Validate() As Boolean
    Dim oCC As ContentControl
    Validate = True
    For Each oCC In ActiveDocument.ContentControls
    If oCC.ShowingPlaceholderText = True Then
    MsgBox "Fill in the form and try again"
    Validate = False
    Exit For
    End If
    Next oCC
    End Function
    [/VBA]
    Greg

    Visit my website: http://gregmaxey.com

  3. #3
    Thanks Greg! I'm working with that.

    Is there a way to make it so some of the content controls could be left blank? Or a way that you could just prompt for all the fields and it will fill itself in?

    Thanks for your help!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •