locked
How to create custom shortcut menus in Access 2010? RRS feed

  • Question

  • Hi everybody,

    My question may be somewhat misleading because I actually know how to create a shortcut menu in Access 2010, for the most part, but I'm having issues with adding certain elements to the menu.

    For instance, I've successfully added a msoControlButton to Print, display One Page, display Two Pages, and Save as PDF/XPS. I've also successfully added a msoControlButton that uses a custom .OnAction function (I created a function that would email a report as .pdf as an attachment instead of giving the user different file choices).

    My issue is that I'm having a difficult time matching up FaceIDs with built-in controls that I'd like to use on my menu. For instance, on the default shortcut menu, there's an item for Zoom and a dropdown that has the different zoom choices (100%, 75%, etc.). I'm pretty confident that I probably have to use the msoControlButtonDropdown, but I can't figure out which FaceID to assign because, from what I've personally seen, there are at least 16,000 FaceIDs.

    Question #1: Is there a resource I can use to determine which FaceIDs are assigned by default in Access to serve certain functions, such as the Zoom I'm referring to on the default shortcut menu? I can display the FaceIDs, which allows me to see the picture, but there's no way, from what I can tell, to determine the default .OnAction for any of the FaceIDs. Not to mention, there are oftentimes the same picture showing for multiple FaceIDs (zoom just happens to be one of them). Then, there's the issue with the Zoom I'm referring to also not having a picture associated with it on the default shortcut menu...so, that's another layer preventing me from easily adding this to my menu.

    Question #2: Let's say that I wanted to create a custom function to mimic the Zoom that appears on the default shortcut menu...how can I add items to the msoControlButtonDropdown so that it will serve the purpose I'm intending it to serve by adding the Zoom to the shortcut menu?

    Thanks,
    beacon

    Thursday, April 26, 2012 9:58 PM

Answers

  • Nevermind, I've resolved my own issue. I used the code provided HERE to list the items on a menu, but I added cBarControl.ID to the GetSubMenuNames function. Then I checked the cBarControl.Type to make sure I had the right one (I didn't...I thought it was msoControlButtonDropdown, but it was really msoControlComboBox).

    When I added it to my existing code and re-registered the shortcut menu, the Zoom command/control showed up when I was in Print Preview for a report (FYI...it won't show up in Layout View).

    Thanks,
    beacon

    • Marked as answer by beacon5 Friday, April 27, 2012 4:51 PM
    Friday, April 27, 2012 4:51 PM

All replies

  • Nevermind, I've resolved my own issue. I used the code provided HERE to list the items on a menu, but I added cBarControl.ID to the GetSubMenuNames function. Then I checked the cBarControl.Type to make sure I had the right one (I didn't...I thought it was msoControlButtonDropdown, but it was really msoControlComboBox).

    When I added it to my existing code and re-registered the shortcut menu, the Zoom command/control showed up when I was in Print Preview for a report (FYI...it won't show up in Layout View).

    Thanks,
    beacon

    • Marked as answer by beacon5 Friday, April 27, 2012 4:51 PM
    Friday, April 27, 2012 4:51 PM
  • I'm glad that you have solved the issue and thanks for sharing the solution with us.

    Have a nice day.


    Yoyo Jiang[MSFT]
    MSDN Community Support | Feedback to us

    Monday, April 30, 2012 5:45 AM
  • This video answered my shortcut menu FacId questions.

    http://www.youtube.com/watch?v=G0OetcYcbM8


    If this post answered or helped you find the answer to your question, please mark it as such for other Forum users knowledge.

    Monday, August 26, 2013 7:07 PM