Quote:
Originally Posted by Guessed
Are you using a password on the form protection? Assuming there is no password, and the form is protected before the macro is run, the following modifications would be required.
Code:
Sub ClearForm()
Dim aCC As ContentControl
ActiveDocument.Unprotect
For Each aCC In ActiveDocument.ContentControls
aCC.Range.Select
If aCC.Type <> wdContentControlDropdownList Then
aCC.Range.Text = ""
Else
aCC.Type = wdContentControlText
aCC.Range.Text = ""
aCC.Type = wdContentControlDropdownList
End If
Next aCC
ActiveDocument.Protect wdAllowOnlyFormFields
End Sub
This code will fail if the form is not already protected or has a password so a better solution would be to add more lines of code to check first.
|
I'm sorry, I tried but I do not know how to do it.
The form is attached, I would appreciate it if you could explain to me how.