View Single Post
 
Old 11-22-2017, 08:27 PM
kinimv kinimv is offline Windows 10 Office 2016
Novice
 
Join Date: Oct 2017
Location: Seattle, WA
Posts: 9
kinimv is on a distinguished road
Default

Hey macropod, I successfully found a way around the character limit by storing the excel columns as arrays.

However, in other parts of my document, I am still using value to fill in multiple fields from the dropdown. Which brings me to my question: In your first post in this thread, your code included the following:

Code:
 With xlWkBk
      With .Worksheets(StrWkShtNm)
        ' Find the last-used row in column A.
        LRow = .Cells(.Rows.Count, 1).End(xlUp).Row
        ' Populate the content control titled 'ID', with Column A for the 'ID' as the
        ' content control Text and the values from columns B-E as the content control
        ' value, using a "|" separator
        ActiveDocument.SelectContentControlsByTitle("ID")(1).DropdownListEntries.Clear
        For i = 1 To LRow
          ActiveDocument.SelectContentControlsByTitle("ID")(1).DropdownListEntries.Add _
            Text:=Trim(.Range("A" & i))
          'or, for example, to add the contents of column B to the content control's 'value':
          'ActiveDocument.SelectContentControlsByTitle("ID")(1).DropdownListEntries.Add _
            Text:=Trim(.Range("A" & i)), Value:=Trim(.Range("B" & i))
        Next
      End With
    .Close False
  End With
I can get the contents of column B to be my value, but I cannot see how the value can be from B-E columns using a "|" separator. Is that part missing from your code, or am I missing something?
Thanks