Results 1 to 3 of 3

Thread: Customs Popup menu problem. Please Help

  1. #1

    Thread Starter
    Fanatic Member Avatarp's Avatar
    Join Date
    Sep 2002
    Location
    Calgary
    Posts
    826

    Customs Popup menu problem. Please Help

    In Excel XP I have created shortcut menus (Popup Menus). To set a custom image to a control in my shortcut menu I have the following line of code:

    Code:
    Set cbc = cb.Controls.Add
        With cbc
            .Caption = "&Show chart for selected contract month..."
            .OnAction = "Datafile.xls!ShowChart"
            .Picture = LoadPicture(PortmgrPath & "\Images\Chart_PlotGraph.bmp")
        End With
    I also have to reference the Office 10 Object Library. The problem here is that when I install my application on a computer with Office 2000, I get an error.

    "Object does not support property or method..." at the .Picture statement.

    So it seems Office 2000 doesn't support this method of putting an image to a control.

    There must be a way to set the image on a control in Office 2000. If my image was a builtin control image it would be easy.

    Any help would be appreciated


  2. #2
    Fanatic Member WorkHorse's Avatar
    Join Date
    Jul 2002
    Location
    Where you live.
    Posts
    591
    In Office 2000 there is no Picture property to popup menu controls (but it would be nice!). If that works in Office XP, I'm not sure why a reference to the MSO library doesn't work, but in my experience references in VBA don't "carry back". Probably MS doesn't allow it so everyone has to buy their new product, but I don't know much about how VBA transfers versions of MSO library references.

    The best you get in Office 2000 is the PasteFace function to paste an image from the clipboard. For anything other than standard images, you have to send the image you want to the clipboard and then PasteFace to the popup control.

    Hope that helps, at least a little.

  3. #3

    Thread Starter
    Fanatic Member Avatarp's Avatar
    Join Date
    Sep 2002
    Location
    Calgary
    Posts
    826

    I used the PasteFace method to handle the icon.

    I designed a toolbar with all the icons I would be using in my popup menus. This gave me the ability to have icons in my popup menus. by copying the control using the index value to locate it and then PasteFace when I build the Popup.

    Thanks for all the help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width