Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / April 2007

Tip: Looking for answers? Try searching our database.

Word2007; width of toolbar dropdown list

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ed - 14 Apr 2007 02:49 GMT
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)
Cindy M. - 18 Apr 2007 17:27 GMT
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)
[quoted text clipped - 6 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 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 - 19 Apr 2007 03:10 GMT
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 :-)

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.