none
Legacy Form Field inside a locked content control

    Question

  • Hello,

    I have been working on this issue for last one month. Still i couldn't find any theoretical answer.

    In a protected word document(filling form protection), and locked content controls, if i use a free form field i'm having issues using them.

    When using the document, sometimes free form fields isn't accessible(modification is locked message) for entering data or locked content control becomes editable and happens on all content controls with free form field in the document. But if there are no free form field in the content control then it remains locked.

    Question: Can a free form field be used inside an content control with locked status ?. If used, will the Content Control be unlocked automatically ?

    Wednesday, June 12, 2013 6:53 PM

Answers

  • Note that it isn't recommended to use both content controls and legacy text form fields in the same document.

    Stefan Blom, Microsoft Word MVP
    Thursday, June 13, 2013 7:45 AM
  • Hi Karthick

    As Stefan mentioned at the beginning of this discussion, content controls are not designed to work with form fields. But content controls do respect form fields protection. In that mode, form fields are editable, while the rest of the document is not. That is taking precedence over the locking of the content control.

    When content controls are nested, if the "outer" content control is locked for editing and the inner content control is not, then you're still able to type into the inner content control. This is true whether forms protection is on or not. But any text in the outer content control remains "locked" and cannot be changed by the user.

    The behavior in both cases is by design.


    Cindy Meister, VSTO/Word MVP, my blog

    Tuesday, June 25, 2013 12:45 PM

All replies

  • Note that it isn't recommended to use both content controls and legacy text form fields in the same document.

    Stefan Blom, Microsoft Word MVP
    Thursday, June 13, 2013 7:45 AM
  • Could you please be more specific about what you mean by "locked content controls"? Do you mean locked for editing, or locked so they can't be deleted?

    Which version of Word?

    Why would you be inserting form fields into content controls?


    Cindy Meister, VSTO/Word MVP, my blog

    Thursday, June 13, 2013 12:50 PM
  • Cindy,

    I meant content controls can't be edited.

    It happens in both Word 2010 and Word 2013. I don't know if the same will happen in word 2007 as well.

    That is a need from our application.

    Ex: Forms Fields are used as user editable items in the document. Where as content controls are used as non-editable item. In the document, sometimes we have necessity to have user editable field. ex: A customer phone number. While automating, we fill those information. After that end user still reviews and modify these documents, but they can only modify those free form fields.

    Hope this answers your question.

    Thanks

    Karthick Kannaiyan

    Thursday, June 13, 2013 1:41 PM
  • My suggestion would be to nest a content control within another content control, not locking the content control into which the user should be able to type a value.

    As Stefan mentions, the two types of fields are not intended to be used together in the same document.


    Cindy Meister, VSTO/Word MVP, my blog

    Thursday, June 13, 2013 2:18 PM
  • Cindy,

    We have decided to do that, but checking to see if that's a normal behavior when a form field is present inside a content control which is locked for editing.

    Thanks

    Karthick

    Thursday, June 13, 2013 2:28 PM
  • Hi,

    I would like to ask about the checking result. Does it work as expected?

    Since you haven't responded for a few days, I temporarily mark Cindy's reply as answer. If you disagree with it, please unmark it and post your doubt. Thanks for your understanding.

    Regards,


    Damon Zheng
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Sunday, June 23, 2013 3:12 PM
  • That is one of the solution to my problem and it does work as intended.

    But it didn't answer my question.

    How different is to use nested content controls and form field inside an content control ?.

    My thought process was, if a form field is present inside a content control(locked for editing) which becomes editable when typing on form field is due to change in formfield range which changes the range of content control.

    Does the same happen when content controls are nested ?. 

    That was my thought process. I found the solution to the problem, but i wanted to know why does the content control(locked for editing) becomes unlocked when a form field is present and the document is protected only for filling forms ?


    Karthick Kannaiyan

    Monday, June 24, 2013 10:22 PM
  • Hi Karthick

    As Stefan mentioned at the beginning of this discussion, content controls are not designed to work with form fields. But content controls do respect form fields protection. In that mode, form fields are editable, while the rest of the document is not. That is taking precedence over the locking of the content control.

    When content controls are nested, if the "outer" content control is locked for editing and the inner content control is not, then you're still able to type into the inner content control. This is true whether forms protection is on or not. But any text in the outer content control remains "locked" and cannot be changed by the user.

    The behavior in both cases is by design.


    Cindy Meister, VSTO/Word MVP, my blog

    Tuesday, June 25, 2013 12:45 PM