View Single Post
 
Old 10-13-2021, 02:09 AM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2019
Expert
 
Join Date: Aug 2014
Posts: 4,144
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

You can choose whether to have the check box unchecked when you run the macro.e.g.
Code:
Sub ClearForm()
Dim oCC As ContentControl
    If ActiveDocument.ProtectionType <> wdNoProtection Then
        ActiveDocument.Unprotect
    End If
    For Each oCC In ActiveDocument.ContentControls
        On Error Resume Next
        oCC.Range.Editors.Item(1).Delete
        On Error GoTo 0
        Select Case oCC.Type
            Case Is = wdContentControlDropdownList
                oCC.Type = wdContentControlText
                oCC.Range.Text = ""
                oCC.Type = wdContentControlDropdownList
            Case Is = wdContentControlCheckBox
                oCC.Checked = False
            Case Else
                oCC.Range.Text = ""
        End Select
        oCC.Range.Editors.Add (wdEditorEveryone)
    Next oCC
    ActiveDocument.Protect wdAllowOnlyReading
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote