In 2003 and below, I can create a dropdown list in a new tool bar like this
CommandBars(listnameis).Controls.Add(Type:=msoControlDropdown)
control its width with the ".width = ###" command.

In 2007, with all addins shoved into the same window, I no longer seem to be
able to control widths. When 'undecended,' they are fairly narrow, and when
decended, they take up the entire width of the screen! This is not an
acceptable behavior.

Is there a way to control the width of msoControlDropdown lists in 2007?

Ed (in Virginia)

Re: Word2007; width of toolbar dropdown list by Cindy

Cindy
Wed Apr 18 11:27:35 CDT 2007

Hi Ed,

> In 2003 and below, I can create a dropdown list in a new tool bar like this
> CommandBars(listnameis).Controls.Add(Type:=msoControlDropdown)
> control its width with the ".width = ###" command.
>
> In 2007, with all addins shoved into the same window, I no longer seem to be
> able to control widths. When 'undecended,' they are fairly narrow, and when
> decended, they take up the entire width of the screen! This is not an
> acceptable behavior.
>
> 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 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 :-)


Re: Word2007; width of toolbar dropdown list by Roy

Roy
Wed Apr 18 21:10:17 CDT 2007

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

"Cindy M." <C.Meister-C@hispeed.ch> wrote in message
news:VA.00000cc2.01e426df@speedy...
>> In 2003 and below, I can create a dropdown list in a new tool bar like
>> this
>> CommandBars(listnameis).Controls.Add(Type:=msoControlDropdown)
>> control its width with the ".width = ###" command.
>>
>> In 2007, with all addins shoved into the same window, I no longer seem to
>> be
>> able to control widths. When 'undecended,' they are fairly narrow, and
>> when
>> decended, they take up the entire width of the screen! This is not an
>> acceptable behavior.
>>
>> 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?



Re: Word2007; width of toolbar dropdown list by Cindy

Cindy
Thu Apr 26 08:45:17 CDT 2007

Hi Roy,

> 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
>
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 :-)


Re: Word2007; width of toolbar dropdown list by Ed

Ed
Fri Apr 27 04:42:45 CDT 2007

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
==============
"Cindy M." <C.Meister-C@hispeed.ch> wrote in message
news:VA.00000d62.011d887f@speedy...
> Hi Roy,
>
>> 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
>>
> 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 :-)
>



Re: Word2007; width of toolbar dropdown list by Cindy

Cindy
Fri Apr 27 09:43:44 CDT 2007

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 :-)


Re: Word2007; width of toolbar dropdown list by Roy

Roy
Fri Apr 27 17:38:02 CDT 2007

Great idea. I will try that. Thanks!

"Cindy M." <C.Meister-C@hispeed.ch> wrote in message
news:VA.00000d71.006a9d94@speedy...
> 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 :-)
>