View Single Post
 
Old 04-25-2025, 04:58 AM
gmaxey gmaxey is offline Windows 10 Office 2019
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,598
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

Paul, of course you are correct (at least partially in my opinion). My statement was certainly misleading and incorrect. CCs do work in documents restricted for filling in forms. What doesn't work is the the line of code that I provided to write a value to the "Company" CC. You can't do that when the form is restricted for filling in forms. You would first have to unprotect the document.

Code:
Case "Contractor"
      For Each oDLE In .DropdownListEntries
        If oDLE.Text = .Range.Text Then
          .Range.Text = oDLE.Value
          ActiveDocument.Unprotect 'plus password if used.
          ActiveDocument.SelectContentControlsByTitle("Company").Item(1).Range.Text = oDLE.Value
          ActiveDocument.Protect wdAllowOnlyFormFields, False 'Plus password if ture
          Exit For
        End If
      Next oDLE

Now, where our opinions differ is "Where they don't work well is in documents that also contain formfields." Personally, I have never encountered a difficulty.
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote