none
dropdownlist entries RRS feed

  • Question

  • Have a dropdown list in a word doc that was created on previous edition of office, trying to edit list as information needed in list has changed.  In previous version I was able to create as many (.DropdownListEntries.Add "             ", "  "), as needed, but now it will only work if i make <23 separate entries, once I enter that 23rd entry I have an error msg and 23rd item isnt visible in list? (a friend helped me code it), is there something with this part of the code that is limiting me to 22 entries?

    Dim oRng As Word.Range
    Dim oCC As Word.ContentControl
    Dim xPath As String
    Dim pTitle As String
    Dim pNodeBaseName As String
    Set oRng = Selection.Range
    On Error GoTo Err_Handler
    Set oCC = ActiveDocument.ContentControls.Add(wdContentControlDropdownList, oRng))

    Any help would be great thanks

    Wednesday, December 30, 2015 6:12 PM

All replies

  • You have an extra unwanted bracket at the end of the set oCC line, but apart from that it looks OK and if you add

        For i = 1 To 30

            oCC.DropdownListEntries.Add "Test " & i
        Next i

    after your published code it will add 30 items to the list without problem.


    Graham Mayor - Word MVP
    www.gmayor.com


    Thursday, December 31, 2015 5:18 AM