Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #29  
Old 07-18-2020, 02:15 AM
markarius markarius is offline Help with cascading dropdown list Windows 10 Help with cascading dropdown list Office 2019
Novice
 
Join Date: May 2020
Posts: 4
markarius is on a distinguished road
Default Content Control as combobox instead of dropbox

Hi

I need help with a small issue in my code.
Basically, the code has parent dropbox "Lives with", and if user selects "recipient lives alone" then it currently limits child dropbox (Occupants) to "N/A"
but if user selects "Recipient shares home" I would like for it to output a value, but for that box to be a combo box and not a dropbox, meaning that user can edit the output values instead of locked field. I would appreciate all the help I can get on this. Thanks!



Quote:
' /// RECIPIENT LIVES WITH OTHERS - OTHER OCCUPANTS
' note: lives alone = N/A (ok), but lives with other needs to allow custom text but DB is locked.
' reminder: once code is ready add "Lives with" to Document_ContentControlOnEnter
If .Title = "Lives with" Then
If StrOption = .Range.Text Then Exit Sub
Select Case .Range.Text
Case "Recipient lives alone"
StrOut = "N/A"
Case "Recipient shares home"
StrOut = "Occupant1; Occupant2" ' << need this to be editable.
Case Else
.Type = wdContentControlText
.Range.Text = ""
.Type = wdContentControlComboBox
End Select
With ActiveDocument.SelectContentControlsByTitle("Occup ants")(1)
.DropdownListEntries.Clear
For i = 0 To UBound(Split(StrOut, ","))
.DropdownListEntries.Add Split(StrOut, ",")(i)
Next
.Type = wdContentControlText
.Range.Text = ""
.Type = wdContentControlDropdownList
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Dropdown list, Macro shield5 Excel Programming 7 10-27-2013 01:51 AM
VBA: How to place dropdown list next to text YigalB Word VBA 0 08-11-2013 01:48 PM
block selection in dropdown list Intruder Excel 2 01-10-2013 10:20 AM
Help with cascading dropdown list dropdown list for documents r_p_t_0 Word 2 12-18-2012 05:55 AM
Dropdown list of email addresses J Partridge Outlook 1 01-13-2011 06:37 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:32 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft