Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default icons for custom menu choices

Get the icon in the clipboard, then use pasteface on the button. (doing
this with code)

Regards,
Tom Ogilvy

John A Grandy wrote in message
...
how to add icons to custom choices added to the cell menu (the right-click
menu) such as the ones displayed for Cut Copy Paste ... ?




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default icons for custom menu choices

Thanks Tom. But how to programatically load an icon from a .ico file into
the clipboad?


"Tom Ogilvy" wrote in message
...
Get the icon in the clipboard, then use pasteface on the button. (doing
this with code)

Regards,
Tom Ogilvy

John A Grandy wrote in message
...
how to add icons to custom choices added to the cell menu (the

right-click
menu) such as the ones displayed for Cut Copy Paste ... ?






  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default icons for custom menu choices

There may be a better way, but I got this to work. You might want to play a
bit with the sizing of the image in the image control before you do the copy
since it is copying the whole image control - not sure how this will affect
background color and so forth.

Sub PasteAFace()
Dim cb_btn As CommandBarButton
Dim ictrl As MSForms.Image
Dim oleObj As OLEObject
Set oleObj = ActiveSheet.OLEObjects.Add( _
ClassType:="Forms.Image.1", _
Link:=False, _
DisplayAsIcon:=False, _
Left:=193.5, Top:=185.25, _
Width:=66, Height:=63)
Set ictrl = oleObj.Object
With ictrl
.PictureSizeMode = fmPictureSizeModeZoom
.Picture = LoadPicture("C:\windows\winupd.ico")
End With
With oleObj
.CopyPicture Appearance:=xlScreen, Format:=xlPicture
.Delete
End With

Set cb_btn = CommandBars("Custom 3").Controls(1)
cb_btn.PasteFace
End Sub

--
Regards,
Tom Ogilvy





John A Grandy wrote in message
...
Thanks Tom. But how to programatically load an icon from a .ico file into
the clipboad?


"Tom Ogilvy" wrote in message
...
Get the icon in the clipboard, then use pasteface on the button. (doing
this with code)

Regards,
Tom Ogilvy

John A Grandy wrote in message
...
how to add icons to custom choices added to the cell menu (the

right-click
menu) such as the ones displayed for Cut Copy Paste ... ?








Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I make a drop-down menu without cells containing the choices? Caeres Excel Discussion (Misc queries) 2 October 24th 08 04:34 AM
How can I change labels to a table for showing menu choices Ron for rehearsal dinner Excel Discussion (Misc queries) 2 August 27th 06 11:17 PM
Duplicate Menu Choices JCLSB Excel Discussion (Misc queries) 1 December 21st 05 01:33 AM
Format from menu will not offer options or choices? Tribeventure Excel Discussion (Misc queries) 0 December 6th 05 08:16 PM
How do I change the order of choices in menu File- Send To SCPC7018 Excel Worksheet Functions 2 August 4th 05 02:11 AM


All times are GMT +1. The time now is 01:52 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"