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

    Menu IDs problem with foreign versions (2000 - 2007)

    On a French version of Office 2003 I encounter an error 5 on the following. I suspect I need to make use of some MS menu IDS rather than hard coded ("File") as done. Where do I find the IDs for these?
    Application.CommandBars("File").Controls("Send To").Controls("Mail Recipient (as Attachment)...").OnAction = ""

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

    Re: Menu IDs problem with foreign versions (2000 - 2007)

    You can type the following in the Immediate window:

    ? Application.CommandBars("File").Controls("Send To").Controls("Mail Recipient (as Attachment)...").ID

    and press Enter.

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

    Re: Menu IDs problem with foreign versions (2000 - 2007)

    Thank you Hans. Isn't there a list of all of these IDs shjowing their Microsoft reserved Paramaters for these? I know I have seen something like that but can't find it.

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

    Re: Menu IDs problem with foreign versions (2000 - 2007)

    You can generate such a list yourself:

    Word: How to Generate a List of Command Bar Names, Captions, and ID Numbers

    Excel: <post:=529,988>post 529,988</post:>

    To create a similar list for other Office applications, you could use Automation from within Word or Excel.

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

    Re: Menu IDs problem with foreign versions (2000 - 2007)

    As I understand it, using menu names like "Application.CommandBars("File").Controls("Sen d To")" should work in a foreign language version as well even if the menu itme "File", "Send To" do not have the same spelling.

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

    Re: Menu IDs problem with foreign versions (2000 - 2007)

    I have the Dutch language version of Office XP. CommandBars("File") is understood OK even though the File menu has a different name in Dutch, but I *must* use the Dutch names of the menu items. Application.CommandBars("File").Controls("Send To") causes Error 5 in my version. So if you want your code to be used in non-English versions, you should use the ID, in this example Application.CommandBars.FindControl(ID:=30095). This works in all versions.

Posting Permissions

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