Cindy, here is a snippet of the VBA code.
Set mybar = CommandBars.Add(name:="ColorList", Position:=msoBarTop, _
temporary:=True)
Set NEWLIST = mybar.Controls.Add(Type:=msoControlDropdown)
NEWLIST.Width = 125
NEWLIST.DropDownLines = 15
For n = 1 To FileCountIs
NEWLIST.AddItem ColorIs(n)
Next
>> In 2003 and below, I can create a dropdown list in a new tool bar like
>> this
[quoted text clipped - 9 lines]
>>
>> Is there a way to control the width of msoControlDropdown lists in 2007?
Well, I don't see any way to control the widths. OTOH, the descended list
isn't any wider than the collapsed one, on my installation.
Can you share some code with us that builds the control where you're seeing
the problem?
Cindy M. - 26 Apr 2007 14:45 GMT
Hi Roy,
> Set mybar = CommandBars.Add(name:="ColorList", Position:=msoBarTop, _
> temporary:=True)
[quoted text clipped - 4 lines]
> NEWLIST.AddItem ColorIs(n)
> Next
Well, after correcting it for missing functions...
I still can't reproduce the problem - I don't see the dropdown list
extending across the width of the document/Word window/screen. If the
text is shorter than the width of the control, the dropdown has that
width. If the text is longer, the dropdown extends so that the text can
fit.
Any chance your functions are dumping in a lot of empty spaces, thus
forcing this extreme width?
Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org
This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :-)
Ed - 27 Apr 2007 10:42 GMT
Actually, that is exactly what is happening, but I don't want it to happen.
There is text at the right of the list that I do not want users to see.
That's why I want to set the width of the control to a width that will only
display the 50 left-most characters in any row. Word2007 seems to not let me
do that.
Roy
==============
> Hi Roy,
>
[quoted text clipped - 25 lines]
> This reply is posted in the Newsgroup; please post any follow question
> or reply in the newsgroup and not by e-mail :-)
Cindy M. - 27 Apr 2007 15:43 GMT
Hi Ed,
> There is text at the right of the list that I do not want users to see.
> That's why I want to set the width of the control to a width that will only
> display the 50 left-most characters in any row. Word2007 seems to not let me
> do that.
No, it doesn't. Why don't you set up the combobox with columns? Then you can
choose to leave some columns invisible (width of 0).
Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org
This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :-)
Roy Lasris - 27 Apr 2007 23:38 GMT
Great idea. I will try that. Thanks!
> Hi Ed,
>
[quoted text clipped - 17 lines]
> reply
> in the newsgroup and not by e-mail :-)