Share via

Conditionally show/hide text content control

Anonymous
2018-07-10T08:04:22+00:00

Hi, I would like to conditionally hide/show the text content control based on the value of another content control dropdown list. For example, if the user select Option 1, TextCC1 display. If Option 2, TextCC2 display. Ideally if the user chose the wrong option and choose again, the first TextCC will delete and add the new one. Is that possible at all?

Thanks

Microsoft 365 and Office | Word | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Anonymous
    2018-07-10T11:13:27+00:00

    Yes it is possible if the form used VBA macros. The document's format would have to be either "docm" or a "dotx" that was generated dynamically from a "dotm" attached template.

    Selecting an Option from the Combo Box control would invoke a specific routine that was part of the ThisDocument class of the document or the attached template. The routine is:

    Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)

    Based on what was selected from the Combo Box the other Text Content controls would be dynamically created. I would suggest placing those other controls in either an addressable table cell or a bookmark. 

    This is not a quick and easy solution and requires a fair amount of coding, so at least for me, I would only do it for a fee.

    If you are interested, you can contact me using the email in my signature line.

    Was this answer helpful?

    0 comments No comments