![]() |
|
|||||||
|
|
Thread Tools | Display Modes |
|
#4
|
|||
|
|||
|
Thanks Greg. Here's my problem. I already have a macro with Sub Document_ContentControlOnExit(ByVal CCtrl As ContentControl, Cancel As Boolean), so when I try to start another one, it tells me it's already in use. I've tried merging them together and that didn't work. It just messed up the first one. Did I mention I'm not a programmer and have no idea what I'm doing LOL. This is said current macro using the ContentControlOnExit:
Private Sub Document_ContentControlOnExit(ByVal CCtrl As ContentControl, Cancel As Boolean) Dim oDLE As ContentControlListEntry With CCtrl If .Type = wdContentControlComboBox Then For Each oDLE In .DropdownListEntries If oDLE.Text = .Range.Text Then .Range.Text = oDLE.Value Exit For End If Next End If End With End Sub That said, I was trying to avoid having to spell out exactly the contractor name that is selected in the drop down as there is no difference in Display Name and Value as you show by using the Case function. The above macro is being used to select the Value instead of the Display name in dropdowns that are different. I just want if Company A is selected from the Contractor dropdown, I want my Company text box to show Company A. Can I add what I want to the above macro somehow? If this is not possible, I will have to type out all of the companies as you have suggested by using the Case function, but how do I merge it with the above so I don't get an error? This will be an internal document only. It's basically a contract that I'm trying to make idiot proof LOL. |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Auto populate a text field based on Content Control Dropdown List
|
matthias92701 | Word VBA | 2 | 05-02-2019 03:54 PM |
| Copy Formatted Text in one Rich Text Content Control to another Rich Text Content Control | Haygordon | Word | 1 | 04-05-2019 05:43 AM |
Auto populate text box based on drop-down content control and repeat the process via copy paste
|
helenndp | Word VBA | 2 | 09-27-2018 11:04 AM |
| Combo Box Content Control Calculate on selection help | ciresuark | Word | 0 | 03-06-2015 01:49 PM |
How do you set rich text in a content control
|
Testor | Word VBA | 4 | 07-08-2012 07:55 AM |