View Single Post
 
Old 09-16-2018, 03:21 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,375
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by jeffreybrown View Post
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.
You could leave the line:
StrDetails = Replace(.DropdownListEntries(i).Value, "|", Chr(11))
as is and not have any | separators, or change it to:
StrDetails = .DropdownListEntries(i).Value

Later in the same thread (https://www.msofficeforums.com/word-...html#post68709) there is advice on how to reference a content control via its title rather than its index #. If you really want to know the index #, select the content control and run:
Code:
Sub GetIndex()
MsgBox ActiveDocument.Range(0, Selection.Range.End).ContentControls.Count
End Sub
PS: Please post Word programming threads in the Word VBA forum.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote