
You can also use the value of another field in the data source as the default value for a control. If you want default text to appear inside a control when a user first opens the form, you can type that text in the Value box. If you need to bind a rich text box to a different field, right-click the rich text box, and then click Change Binding on the shortcut menu. If MsgBox("Remove hightlight?", vbYesNo, "Reformat Text?") = vbYes ThenĬ: Changing the field name does not change the binding between a rich text box and field in the data source. Is this possible and am I on the right path? So far I have been unable to get this to work. Greg, out of curiosity, I have been trying to add a precheck to the "User Control" code you suggested where IF the text is already unhighlighted exit the routine and not prompt the user. Just click in the CC and run:įor Each oCC In ActiveDocument.ContentControls If MsgBox("Remove hightlight?", vbYesNo, "REFORMAT") = vbYes ThenĬ = wdNoHighlight Private Sub Document_ContentControlOnEnter(ByVal ContentControl As ContentControl) To add a bit of user control, I'll suggest an edit to Graham's method:



While the selected range appears the same, clearly the triple click method is picking up a part of the CC that can't be edited. Now just select the text as you have done as a work around and run that code again. 'A basic Word macro coded by Greg Maxey,,

Using that document, triple click the text and run: I'm not sure if that is intentional or not. One titled "Finding" containing the highlighted text nested in another CC (otherwise empty) also titled "Finding". Before going forward, your sample document contain 2 content controls. However, it this case I think the issue is with how the triple click selection works (which could also be considered buggy). Yes, I've observed several oddities over the years with CCs and highlighting.
