Question : Word document which has some checkboxes and dropdown menu needs some tweeking in it.

Hi,

Word document which has some checkboxes and dropdown menu needs some tweeking in it.

This is the file that i have as reliever checklist.
What i want is
1. When printed the dropdown and checkboxes should not be printed.Just the names in it has to be shown and a tick mark instead of check box has to be shown.
2. Need a button to check if all checkboxes are checked and if any name is mentioned in the drop down.If any blanks has to warn me.
3. Date has to be automatically taken from system date or need a selector to choose from.
Can anyone help me in this please.

Attached is the word file.

Regards
Sharath

Answer : Word document which has some checkboxes and dropdown menu needs some tweeking in it.

I would advise against using Active-X controls on a Word document, for the reason that they are not designed for a printed result. You are already using Form Field checkboxes and the document is protected, so why not use Form Field drop downs to select from?

The validation code is in the attached snippet. If you put a button on the document, it will be printed, so you should avoid that. You can create a toolbar button with (Tools/Customize).



For the date, you can put a insert a CreateDate field in your template. Then for each new document, it will automatically have the date and/or time that the new document is created from the template.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
Sub Validate()
    Dim ffld As FormField
    
    For Each ffld In ActiveDocument.FormFields
        Select Case ffld.Type
            Case wdFieldFormCheckBox
                If ffld.CheckBox.Value = False Then
                    MsgBox "Check box " & ffld.Name & " is not checked"
                    Exit Sub
                End If
            Case wdFieldFormDropDown
                If ffld.DropDown.Value = 1 Then 'first entry in dropdown reads "Please Select"
                   MsgBox "Dropdown " & ffld.Name & " has not been set"
                   Exit Sub
                End If
        End Select
    Next ffld
End Sub
Open in New Window Select All
Random Solutions  
 
programming4us programming4us