How do I display strings in a custom toolbar?

A

Alex

Hello,

I would like to display context-sensitive string information on a custom toolbar in Word.

Something like the "Style", "Font" and "Font size" dropdowns on the "Formatting" toolbar, where the displayed information changes based on the formatting of the selection, except that I do not want the user to be able to change the information - only to view it. Therefore, I would prefer it to look like a read-only textbox or, better yet, a label instead of a dropdown.
Also, the string to display is built at runtime and not selected from a set.

What is the best way to achieve it?

Thank you.


Best wishes,
Alex.
 
A

Alex

Alex said:
I would like to display context-sensitive string information on a custom toolbar in Word.

Something like the "Style", "Font" and "Font size" dropdowns on the "Formatting" toolbar,
where the displayed information changes based on the formatting of the selection, except
that I do not want the user to be able to change the information - only to view it.
Therefore, I would prefer it to look like a read-only textbox or, better yet, a label
instead of a dropdown.
Also, the string to display is built at runtime and not selected from a set.

What is the best way to achieve it?

Hmmm...

Posted too quickly.

Looks like setting the style to msoComboLabel should work.

Am I missing anything?


Best wishes,
Alex.
 
A

Alex

Hi Cindy,
Cindy M -WordMVP- said:
You should explain WHY not, if you'd like any input from those
who may read the message thread :)

Sorry. Explanation:

1) The down-arrow of the combo-box is still visible.
Using msoControlEdit instead of msoControlComboBox seems to work (at least in a macro) but...

2) The text in the combo-box is editable by the user.
Setting it to "disabled" is not a good solution since the resulting grey-on-grey text is very hard to read.

So far, the best I could do is using an msoControlButton with .Style = msoButtonCaption.


Best wishes,
Alex.
 
C

Cindy M -WordMVP-

Hi Alex,

My logic may have a hole in it, here, because this idea just came to me, but...

How about a combobox with a caption, but you only use the caption? Set the
combobox to disabled and it's width to 0 (if that's allowed) so that the user
really doesn't notice it's there?
1) The down-arrow of the combo-box is still visible.
Using msoControlEdit instead of msoControlComboBox seems to work (at least in a macro) but...

2) The text in the combo-box is editable by the user.
Setting it to "disabled" is not a good solution since the resulting
grey-on-grey text is very hard to read.
So far, the best I could do is using an msoControlButton with .Style = msoButtonCaption.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
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 :)
 

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