ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Face ID on main menu? (https://www.excelbanter.com/excel-programming/353338-face-id-main-menu.html)

[email protected]

Face ID on main menu?
 
Hi,

I have the following code:

Set myCustMenu = cbWSMenuBar.Controls.Add(Type:=msoControlButton,
befo=iHelpIndex, Temporary:=True)
With myCustMenu
.Style = msoButtonCaption
.Caption = "Test"
.FaceId = 247
.OnAction = "TryME"
End With

The menu bar is not displaying the face ID. Is it not possible to have
a face ID n a menubar button on the main menu?

if i have a sub menu control button on a popup menu it works.

any idea?

thanks


Greg Wilson

Face ID on main menu?
 
Change msoButtonCaption to msoButtonIconAndCaption or to msoButtonIcon if you
only want to display the icon. Alternatively, don't specify the Style as it
defaults to msoButtonIcon. This worked for me:-

Sub Test()
Dim iHelpIndex As Integer
Dim myCustMenu As CommandBarButton
With Application.CommandBars(1)
iHelpIndex = .Controls("Help").Index
Set myCustMenu = .Controls.Add(Type:=msoControlButton, _
befo=iHelpIndex, Temporary:=True)
End With
With myCustMenu
.Style = msoButtonIconAndCaption 'msoButtonCaption
.Caption = "Test"
.FaceId = 247
.OnAction = "TryME"
End With
End Sub

Sub TryMe()
MsgBox "Try me !!!"
End Sub

Regards,
Greg

" wrote:

Hi,

I have the following code:

Set myCustMenu = cbWSMenuBar.Controls.Add(Type:=msoControlButton,
befo=iHelpIndex, Temporary:=True)
With myCustMenu
.Style = msoButtonCaption
.Caption = "Test"
.FaceId = 247
.OnAction = "TryME"
End With

The menu bar is not displaying the face ID. Is it not possible to have
a face ID n a menubar button on the main menu?

if i have a sub menu control button on a popup menu it works.

any idea?

thanks



[email protected]

Face ID on main menu?
 
It works fine now.

Thanks



All times are GMT +1. The time now is 01:04 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com