How to add Icon to Menu item

B

Bob Smedley

I am creating a new command on Word's main Menu Bar with a bunch of sub menu
items below that. I want the sub menu items to be of the "Icon and Caption"
type. I have ICO files for each of the sub menu items. I cannot seem to find
out how to get the image from the ICO file to the sub menu item. Help would
be appreciated.

Here is my code so far...

Set MenuObject = Application.CommandBars("Menu Bar"). _
Controls.Add(Type:=msoControlPopup, _
Temporary:=True)
MenuObject.Caption = "My Menu Bar Item"


Set MenuItem = MenuObject.Controls.Add(Type:=msoControlButton)
MenuItem.OnAction = "MyMacroName"
MenuItem.Caption = "This will eventually do something"
MenuItem.Style = msoButtonIconAndCaption

I know the PasteFace method is available but it depends upon the image
already being in the clipboard. Plus I would like the images to be part of
the DOT file rather than being files on the hard drive. I thought maybe
using an imagelist or image control on a hidden form but the problem is how
to get the image on to the clipboard.

Suggestions?

thanks
 
J

Jezebel

Add a hidden toolbar to the template, containing all the icons you might
wish to use. Then in your macro you can copy them.
 

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