Word2007; width of toolbar dropdown list

E

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?

Ed (in Virginia)
 
C

Cindy M.

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

Roy Lasris

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


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?
 
C

Cindy M.

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

Ed

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
==============
 
C

Cindy M.

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

Roy Lasris

Great idea. I will try that. Thanks!

Cindy M. said:
Hi Ed,

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)


This reply is posted in the Newsgroup; please post any follow question or
reply
in the newsgroup and not by e-mail :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top