Results 1 to 9 of 9
  1. #1
    3 Star Lounger
    Join Date
    Nov 2002
    Posts
    387
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Another Menu ID problem (2000 - 2007)

    I keep running into problems accessing menu items using the menu ID number rather than the menu name. Here is another problem using the ID when using it with the OnAction

    The following works in the English version of Excel 2000 - 2007
    application.CommandBars("File").Controls("Send To").Controls("Mail Recipient (as Attachment)...").OnAction = "FileSendMail"

    So as to handle other language versions I have tried the following and the number ID match the names above in the same order. These lines fail (FileSendMail is a macro in an XLA )
    application.CommandBars.FindControl( Id:= 30002).OnAction = "FileSendMail"
    application.CommandBars.FindControl(Id:= 30095).OnAction = "FileSendMail"
    application.CommandBars.FindControl(Id:= 2188).OnAction = "FileSendMail"
    If I change the OnAction to Enable = False then the menu items do get disabled. What doesn’t this work for OnAction? What am I missing here?

  2. #2
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Another Menu ID problem (2000 - 2007)

    Like this:

    Application.CommandBars("Worksheet menu bar").FindControl(ID:=2188, recursive:=True).OnAction = "FileSendMail"

    Worksheet menu bar is internationally "aware".
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Another Menu ID problem (2000 - 2007)

    (Edited by HansV)

    See Pieterse's reply.

  4. #4
    3 Star Lounger
    Join Date
    Nov 2002
    Posts
    387
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Another Menu ID problem (2000 - 2007)

    Thank you Pieterse that solved the problem!! For Word I have to do the same except use "menu bar" only as the index for CommandBars. I looked at various books on Excel programming and none of them mention or mention little about development with International use in mind.

  5. #5
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Another Menu ID problem (2000 - 2007)

    download my xlmenufundict to get all those Id's in one convenient file:
    http://www.jkp-ads.com/download.asp
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  6. #6
    New Lounger
    Join Date
    Oct 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Office Add-in Toolbar Buttons

    (Edited by HansV to make URL clickable - see <!help=19>Help 19<!/help>)

    Pieterse,

    Jim Bassett thought you'd be most familiar to answer my question. We've an office add-in written in VB6 that comes up in Excel and Word with the toolbar buttons all in Magneta color; this only happens on a French System; I'm not sure if there's something we're missing that is needed for French Language support. We actually did implement Microsoft suggestion of creating transparent Picture for Office CommandBar Buttons, found at this site, http://support.microsoft.com/kb/288771. The suggestion hasn't helped.

    Any suggestions are greatly appreciated.

    Thanks.
    Anu Shah

  7. #7
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Office Add-in Toolbar Buttons

    What happens if you use default icons included with Office itself?
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  8. #8
    New Lounger
    Join Date
    Oct 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Office Add-in Toolbar Buttons

    The default icons in word look fine, just the ones on our add-in toolbar look awful. Here's an attachment to explain what I'm talking about.
    Attached Images Attached Images

  9. #9
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Office Add-in Toolbar Buttons

    Did you try using a different graphics format for the icons (dunno if you can)?
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

Posting Permissions

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