
OCC_Vert2.LockContents = Not ContentControl. Set oCC_Vert2 = ActiveDocument.SelectContentControlsByTag("Vert2").Item(1)

OCC_Lat2.LockContents = Not ContentControl.Checked Set oCC_Lat2 = ActiveDocument.SelectContentControlsByTag("Lat2").Item(1)

OCC_Long4.LockContents = Not ContentControl.Checked Set oCC_Long4 = ActiveDocument.SelectContentControlsByTag("Long4").Item(1) OCC_Long3.LockContents = Not ContentControl.Checked Set oCC_Long3 = ActiveDocument.SelectContentControlsByTag("Long3").Item(1) Your completed code should then look like this: Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean) Once you have verified that you have the correct content control you can then use the value of its Checked property to set the value of the LockContents property of each of the other content controls. You will note that this event handler will fire for every content control in the document, so you need to test the value of ContentControl.Tag to see if it is the one that you need to work with. An empty event handler is then created with the correct syntax. In the right hand drop-down select ContentControlOnExit. You can find this by navigating to the ThisDocument module in the VBE and selecting Document in the left hand drop-down. As there isn't a Change event you need to use the OnExit event. If oCC_Lowers.LockcontentControl = True Thenįirstly a link to a good resource on working with Content Controls: Greg Maxey's Word Content Controls pageĪs your code is an event handler responding to a built-in event, it needs to be in the ThisDocument module. Set oCC_Vert2 = ActiveDocument.SelectContentControlsByTag("Vert2").Item(5) Set oCC_Lat2 = ActiveDocument.SelectContentControlsByTag("Lat2").Item(4) Set oCC_Long4 = ActiveDocument.SelectContentControlsByTag("Long4").Item(3) Set oCC_Long3 = ActiveDocument.SelectContentControlsByTag("Long3").Item(2) Set oCC_Lowers = ActiveDocument.SelectContentControlsByTag("Lowers").Item(1)

I had managed to disable the textboxes but this now seems to have been lost.Īny suggestions would be greatly appreciated. "Long3""Long4" "Lat2""Vert2" are the textboxes I am trying to control. This is my attempt based at varying google responses.
Word 2016 font box how to#
I am therefore having to re-learn how to use content control boxes and their VBA controls. The best benefit of the Font dialog box is its Preview window, at the bottom.
Word 2016 font box software upgrade#
Previously I have been able to use activeX and Legacy tools in the document but after a software upgrade to a 3rd party application the manufacture no longer supports these. Use the Ctrl+D keyboard shortcut to quickly summon the Font dialog box. I am trying to create a form that requires text boxes to be disabled until a checkbox is ticked.
