none
How do you set the column heads for a combobox? RRS feed

  • Question

  • I'm using Word 2010.

    How do you set the column headings for a multi-column combobox?

    I have a combobox with multiple columns.  I set ColumnHeads = true, but I can't figure out how to set the actual headings for each column.

    I'm retrieving the data for the combobox from a SQL Server stored procedure (if it matters).

    I figure since I'm working on Word 2010 this should be possible at this point.

    Thursday, March 22, 2012 12:31 AM

All replies

  • ColumnHeads = True only works in Excel, and only if the RowSource of the combo box is set to a range on a worksheet. It doesn't do anything in Word.

    Unfortunately, the help for the ColumnHeads property fails to mention that.


    Regards, Hans Vogelaar

    Thursday, March 22, 2012 6:59 AM
  • Ok, so I have to find a work around.

    I have added a top row with the column headings (using AddItem) and although I've got this to work properly it doesn't stay at the top of the list.  As soon as you scroll you've lost the heading.  That would be ok if the list was small but it isn't.  Since there's 5 columns the user won't know what they are.  I've got to find a better way.

    What other ingenious ways are there to have column headings (that actually work like column headings) for a combo box list?

    Thursday, March 22, 2012 5:40 PM
  • Well you could place two labels above the Combobox, which indicates the headers, other then that I have no idea at the moment.


    Daniel van den Berg | Washington, USA | "Anticipate the difficult by managing the easy"

    Please vote an answer helpful if they helped. Please mark an answer(s) as an answer when your question is being answered.

    Thursday, March 22, 2012 5:44 PM
    Moderator
  • Daniel's suggestion is the one generally used.

    Regards, Hans Vogelaar

    Thursday, March 22, 2012 8:13 PM
  • That's a good idea, BUT my combobox list extends beyond the boundaries of the user form.  If I could create labels and have them overextend beyond the boundaries of the user form so they match the columns that would be great.

    What about creating a Rectangle shape, can I have that on top of the user form and overlapping the user form boundary?

    Can I create a Rectangle with text in it that overextends beyond the right boundary of the user form?  If so, that would be perfect if I could display that when the combobox list drops down.

    Thursday, March 22, 2012 9:32 PM
  • What do you mean with "that your Combobox list extends beyond the boundaries of the User Form"?

    Can you create a screenshot, and post an example, that would be helpful. Thanks! :)


    Daniel van den Berg | Washington, USA | "Anticipate the difficult by managing the easy"

    Please vote an answer helpful if they helped. Please mark an answer(s) as an answer when your question is being answered.

    Thursday, March 22, 2012 9:36 PM
    Moderator
  • You can set the size for the list portion of the combobox.  Since I have 5 columns I have set the size to 600pt.  The list portion of the combobox jets out past the size of the user form. Here's a screen shot.

    Screenshot1

    Now if I could make a label (maybe using a Rectangle and APIs?) with the 4 headings above the combo box so it looks like this (except with yellow background so the column heading looks like a tooltip), I'd call it good.

    Screenshot 2

    Thursday, March 22, 2012 11:17 PM