Commandbars Custom shortcut Menu - Font Color Picker

TheBaz

Registered User.
Local time
Today, 15:37
Joined
Apr 24, 2014
Messages
12
Hey folks,

I ma currently in the process of creating a pop-up menu to allow my users to do some simple text formatting.

I have used the following code to do so:

Code:
Dim cmbShortcutMenu As Office.CommandBar

' Create the new pop-up menu instance
Set cmbShortcutMenu = CommandBars.Add("popupFormatMenu", msoBarPopup, False, True)

' Add the bold button
cmbShortcutMenu.Controls.Add Type:=msoControlButton, id:=113
' Add the italic button
cmbShortcutMenu.Controls.Add Type:=msoControlButton, id:=114
' Add the underline button
cmbShortcutMenu.Controls.Add Type:=msoControlButton, id:=115
' Add the numbered list button
cmbShortcutMenu.Controls.Add Type:=msoControlButton, id:=11
' Add the bullet list button
cmbShortcutMenu.Controls.Add Type:=msoControlButton, id:=12

Set cmbShortcutMenu = Nothing

This all works perfectly.

The problem is that I now want to add the FontColor picker control and I keep getting an error.

I think the problem lies in the type of control I want to add. According to the Microsoft help files I downloaded the fontColor control is of type Gallery and ID = 11949, so the code should look something like this:

Code:
cmbShortcutMenu.Controls.Add Type:=msoControlButton, id:=11949

I need to replace msoControlButton with something else.

Any ideas?
 
Anyone got any idea about this one?

Still looking for a solution.
 

Users who are viewing this thread

Back
Top Bottom