Text centered in CommandBarPopup (not left-aligned)

D

Diego

Hi,

I am not sure If this is the best forum, but I am a bit stucked...

I am using a CommandBarPopup in an Office toolbar, and I set the text using
'.Caption(...)'. The problem is that the text is centered by default, instead
of 'left-aligned'.

I have installed the Skype Toolbar in my Outlook, which also has a
CommandBarPopup control, and I see the text left-aligned... So it seems to be
something only in my control.

Why can be that? May it be sth about Office in general?

My code:
--------------------------------------------------------------------------------
Dim m_popUpMenu As Office.CommandBarPopup
....
Set m_popUpMenu = .Add(Type:=msoControlPopup, Temporary:=True, Before:=1)

With m_popUpMenu
.Tag = "Options"
.ToolTipText = "Options"
.Enabled = True
.Width = 120
.Caption = "Options"
End With
 
K

Ken Slovak - [MVP - Outlook]

Don't set the width of the control and let it size automatically based on
the caption text you provide.
 
D

Diego

I need to set a minimun size, like skype toolbar does. In that case the
text is left-aligned, why not in my case?
 
K

Ken Slovak - [MVP - Outlook]

I have no idea what the Skype developer is doing, but there is no property
for text alignment that you can call for that. I suppose you could set width
and add spaces after the text, but that would be flaky depending on the
user's screen settings. You might have to derive an algorithm to handle
that.
 

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