View Single Post
 
Old 02-27-2024, 05:02 PM
gmaxey gmaxey is offline Windows 10 Office 2019
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,617
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

Oops, I read your requirement wrong. To append the next value selected to the end of the list you will need a second RichText CC titled "List"


Code:
Option Explicit
Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
Dim oRng As Range
  Select Case ContentControl.Title
    Case "DDList"
      Set oRng = ActiveDocument.SelectContentControlsByTitle("List").Item(1).Range
      oRng.Collapse wdCollapseEnd
      oRng.InsertAfter vbCr & ContentControl.Range.Text
  End Select
lbl_Exit:
  Exit Sub
 End Sub

You may find this helpful:


(Pseudo Multi-Select Dropdown Content Controls
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote