![]() |
#1
|
|||
|
|||
![]()
Hi All,
I have a word document with several ActiveX Textbox controls laid out in a form. I need an event to run on the selection of those controls - specific to the selected control. For some very odd reason Microsoft chose to remove the events for ActiveX controls, so now I'm left trying to code events to trap a change. This will return true if my selection is within an ActiveX Content Control Code:
Selection.Infomation(wdInformation.wdInContentControl) This will return Text within a specific (or known) control Code:
ActiveDocument.ContentControls(strControlName).range.text This apparently returns the ID of the selected control - if it is in design mode Code:
Selection.range.ContentControl(1).ID And I can loop through all control on the document to return all control information. Code:
For i = 1 to ActiveDocument.ContentControls(i).count Debug.Print ActiveDocument.ContentControls(i).ID Next i What is the secret to returning the selected control - and it's corresponding text or information? Alternatively - and this would be magic sauce - an AfterUpdate event of some kind for the control (doesn't exist in word, i know, but... magic. All help appreciated. Cheers |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
font color based on content control pulldown selection | PbFoot | Word VBA | 3 | 01-03-2023 08:22 AM |
Lock or unlock a content control depending on the selection from the drop down list | ncruz | Word VBA | 4 | 10-15-2021 08:50 AM |
![]() |
gennatr12 | Word VBA | 7 | 03-26-2017 08:51 PM |
![]() |
Dudlee | Word VBA | 1 | 09-20-2016 04:58 PM |
Combo Box Content Control Calculate on selection help | ciresuark | Word | 0 | 03-06-2015 01:49 PM |