![]() |
|
#1
|
|||
|
|||
|
I found this thread, but can't figure out two things.
1) How to edit this code for only one additional entry 2) How to know the index number of a control In the first dropdown, there are only be two variables: 150.7 and 185 If 150.7 is selected, I want the other dropdown to read 1.077 If 185 is selected, I need the other dropdown to read 1.044 I have set the first dropdown with the display name as 150.7 and the value as 1.077, but can't figure out adjusting the code below to not need the Replace part. I'm using content control instead of form fields because I read they don't play well together. Also, there are many other content controls on this doc. The code runs fine with the loop, but not really needing the loop and figuring out the index of the content control. Code:
Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
Dim i As Long, StrDetails As String
With ContentControl
If .Title = "Client" Then
For i = 1 To .DropdownListEntries.Count
If .DropdownListEntries(i).Text = .Range.Text Then
StrDetails = Replace(.DropdownListEntries(i).Value, "|", Chr(11))
Exit For
End If
Next
ActiveDocument.ContentControls(2).Range.Text = StrDetails
End If
End With
End Sub
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Content Control content deleted when re-uploading to SharePoint | Peterson | Word | 5 | 06-27-2018 08:13 PM |
One Content Control Checkbox checks another Content Control Checkbox
|
DEsh | Word VBA | 2 | 10-06-2017 08:23 PM |
Clicking the selected Content Control checkbox returns wrong control in vba event
|
DougsGraphics | Word VBA | 2 | 06-24-2015 07:31 AM |
Deleting a table from a content control -- preserving the content control
|
BrainSlugs83 | Word Tables | 8 | 11-14-2013 03:06 AM |
Automatically Updating Content in Text
|
dumbass0101 | Word | 4 | 10-11-2012 07:50 AM |