Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #19  
Old 10-13-2021, 02:09 AM
gmayor's Avatar
gmayor gmayor is offline Reset "Button" to clear Word user-filled form, from all filled details. Windows 10 Reset "Button" to clear Word user-filled form, from all filled details. 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
 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
button "clear format", etc; anchors, functions and properties of OpenType, negative width of symbol? tvan Other Software 1 07-18-2018 03:55 PM
Using outlook form to enforce field to be filled in megatronixs Outlook 1 01-21-2015 01:11 PM
Text form filled shading Barbara Word 2 04-25-2013 05:21 AM
Reset &quot;Button&quot; to clear Word user-filled form, from all filled details. Add a "SAVE" Button to a form template? Dave L Word 9 03-21-2012 07:04 PM
How can create a form in Word 2007 that can be automatically filled? artistech Word 0 08-04-2010 01:05 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:46 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft