Share via

Word Dropdown

Anonymous
2017-09-13T13:58:46+00:00

Hello,

I'm trying to create a drop down with 2 options, the problem I'm running into is that what I'm trying to put in as options exceed the limit of how many characters are allowed in the text box (before anyone asks, no, I can't shorten what I have as options). So I'm wondering if there's an alternative to this, or if there's a way to break said limit. I'm working with Word 2013 and I'm not as savvy with word as I am with excel and adobe, so this is new territory for me. So if anyone can, please break it down step by step, thanks in advance.

Microsoft 365 and Office | Word | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

5 answers

Sort by: Most helpful
  1. Anonymous
    2017-09-16T06:39:13+00:00

    On Mac Word, the situation is as follows

     a. The only control type available in the developer tab are the legacy forms controls

     b. ActiveX controls do not work, as you suspected. AIUI they will never be implemented.

     c. in Word 2016 (at least the 365 version), a number of the content controls do now "function". At least some types will communicate withe the XML data store. However, there are many limitations

        - there are no UI features for inserting them or setting their properties

        - the object model does not yet contain the APIs for content control or xml custom part objects or collections. If you want to access content controls programmatically when Word is running, you have to use the new JavaScript APIs. 

    I haven't looked at a much more detailed level than that so for example I do not know whether the same 256-character limit exists on Mac.

    Was this answer helpful?

    3 people found this answer helpful.
    0 comments No comments
  2. Jay Freedman 207.7K Reputation points Volunteer Moderator
    2017-09-14T23:21:13+00:00

    You can't do this with the legacy dropdown control. You can do it with an ActiveX combo box, and if your choices are 256 characters or less you can do it with a dropdown content control.

    If you can stay within the 256-character limit, and if users all have Word 2007 or later (currently Windows only, not Word for Mac), then the content control is the preferable solution because it will display the entire choice in place.

    If that's not possible, the ActiveX combo box *may* work for you. First, I'm not sure ActiveX is supported in Word for Mac; someone else will have to weigh in on that. Second, the combo box requires macro code to operate, so it will run into security issues on some computers. Third, the combo box itself will display only one line for each choice (it has to scroll sideways to read the whole thing), and the code will have to transfer the complete text of the choice to some location in the document outside the combo box.

    The code will look something like this:

    Private Sub ComboBox1_Change()

        ActiveDocument.Range.InsertAfter ComboBox1.Value & vbCr

    End Sub

    Private Sub Document_New()

        Combo_Initialize

    End Sub

    Private Sub Document_Open()

        Combo_Initialize

    End Sub

    Private Sub Combo_Initialize()

        With ComboBox1

            .AddItem "Four score and seven years ago our fathers brought forth " & _

                 "on this continent a new nation, conceived in Liberty, and " & _

                 "dedicated to the proposition that all men are created equal. "

            .AddItem "But, in a larger sense, we can not dedicate...we can not " & _

                 "consecrate...we can not hallow this ground. The brave men, " & _

                 "living and dead, who struggled here, have consecrated it, far " & _

                 "above our poor power to add or detract. The world will little " & _

                 "note, nor long remember what we say here, but it can never " & _

                 "forget what they did here. It is for us the living, rather, to " & _

                 "be dedicated here to the unfinished work which they who fought " & _

                 "here have thus far so nobly advanced. It is rather for us to " & _

                 "be here dedicated to the great task remaining before us-that " & _

                 "from these honored dead we take increased devotion to that " & _

                 "cause for which they gave the last full measure of devotion-" & _

                 "that we here highly resolve that these dead shall not have " & _

                 "died in vain-that this nation, under God, shall have a new " & _

                 "birth of freedom-and that government: of the people, by the " & _

                 "people, for the people, shall not perish from the earth."

        End With

    End Sub

    Was this answer helpful?

    3 people found this answer helpful.
    0 comments No comments
  3. Anonymous
    2017-09-19T12:48:48+00:00
    1. If your users will have access to your template then you might be able to create building blocks of the two options and then using a building block content control filtered to show only those two building blocks.
    2. If you could uses shorter options to trigger and display the full text then you could possibly use a dropdown CC and its Exit event.  For example, this code is used with a DDCC titled "Test" with three options "X, Y and Z"

    Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)

    Dim Content

      Select Case ContentControl.Title

        Case "Test"

          With ContentControl

           .Type = 1

            Select Case .Range.Text

              Case Is = "X": Content = String(500, "X")

              Case Is = "Y": Content = String(500, "Y")

              Case Is = "Z": Content = String(500, "Z")

            End Select

            .Range.Text = Content

            .Type = 4

          End With

      End Select

    lbl_Exti:

      Exit Sub

    End Sub

    1. Otherwise I suppose you could use a userform.

    Was this answer helpful?

    2 people found this answer helpful.
    0 comments No comments
  4. Jay Freedman 207.7K Reputation points Volunteer Moderator
    2017-09-16T18:09:22+00:00

    Thanks, Peter.

    If the dropdown content control is one of the ones that "function" on the Mac, that may be an acceptable choice -- subject to confirming that it accepts as long an entry as in Windows. If the purpose in this case is just to display one or the other of two choices, the lack of programmatic access won't be important. If the document is created in Windows, the lack of UI on the Mac to insert and configure the control also won't be a problem; it just has to display and be enabled when opened on a Mac.

    Was this answer helpful?

    2 people found this answer helpful.
    0 comments No comments
  5. Anonymous
    2017-09-16T20:36:24+00:00

    Jay,

    AFAICS the OP never mentioned Mac, but I responded to your "someone else will have to weigh in on that" as a courtesy.

    If the OP asks for more info. on the Mac side, we can take it from there.

    Peter

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments