ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Custom Menu (https://www.excelbanter.com/excel-programming/285261-custom-menu.html)

luis

Custom Menu
 
I have a custom menu and i'd like to know if it's posible
to put a symbol before the option, created by me.
The code i'm using is the following, and the property i'm
talking about is submenuitem.faceid=???

Set subMenuItem =
mnuitem.Controls.AddType:=msoControlButton)
subMenuItem.Caption = "Option1"
subMenuItem.FaceId = 17
subMenuItem.OnAction = "Openfile"

Jim Rech

Custom Menu
 
There are two ways that I know of to add custom faces to commandbar
controls. The LoadPicture method is available only for Excel 2002 and 2003
but you can use PasteFace in all versions from Excel 97 on.

You'd have to copy the custom picture to the clipboard and then do a
PasteFace. I put the picture right in a worksheet so:


ActiveSheet.Pictures("Picture 1").Copy
CommandBars("File").Controls("Close").PasteFace
CommandBars("File").Controls("Close").Style = msoButtonIconAndCaption

This adds a custom face to the built-in Close menuitem. You won't see the
face however unless you change its style so that's why I have the third line
above.


--
Jim Rech
Excel MVP




All times are GMT +1. The time now is 02:04 PM.

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