Results 1 to 10 of 10
  1. #1
    mks123's Avatar
    mks123 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2014
    Posts
    33

    How to Create Shortcut

    Hi Frndz,

    Could anyone help me with this line of code..trying to figure out how this macro works.

    Ref site :https://msdn.microsoft.com/en-us/lib.../ff194247.aspx

    Code:
    Sub CreateSimpleShortcutMenu()
    Dim cmbShortcutMenu As Office.CommandBar
    
    
    ' Create a shortcut menu named "SimpleShortcutMenu.
    Set cmbShortcutMenu = CommandBars.Add("FirlstdShortcutMenu", msoBarPopup, False, True)
    
    
    ' Add the Remove Filter/Sort command.
    cmbShortcutMenu.Controls.Add Type:=msoControlButton, ID:=605
    
    
    ' Add the Filter By Selection command.
    cmbShortcutMenu.Controls.Add Type:=msoControlButton, ID:=640
    
    
    Set cmbShortcutMenu = Nothing
    
    
    End Sub
    Regards,


    Mukesh Y

  2. #2
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2013 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    What is your issue?

  3. #3
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,428
    do you mean a shortcut menu (which is what your code is about) or do you mean a shortcut to a file, for example on your desktop?

  4. #4
    mks123's Avatar
    mks123 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2014
    Posts
    33
    thanks for reply guys....

    I just wanted to how can I use this code/ what is the use of this code.
    I have read that this create shortcut somewhere but never figure out.

  5. #5
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,428
    the code you provided is documented, so you can see what it does. The link you provided suggests where to put the code and how to use it - what else do you want to know?

  6. #6
    mks123's Avatar
    mks123 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2014
    Posts
    33
    I'm able to run this code but don't know where it get save ... link display this info "Once you've run the code, the shortcut menu is saved as part of the database. You don't have to run the same code to re-create the shortcut menu every time that you open the database."





  7. #7
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,428
    the link is telling you only need to run it once, not every time you open the database - the database you have run it in will have been updated for all time. If you create a new database, you will need to run the code again in the new database if you want use the same functionality in the new database.

  8. #8
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    You have to read the next paragraph:
    To assign the shortcut menu to a form, form control, or report,
    set the Shortcut Menu property of the object to Yes and
    set the Shortcut Menu Bar property of the object to the name of the shortcut menu.
    For this example, set the Shortcut Menu Bar property to SimpleShortcutMenu.

  9. #9
    mks123's Avatar
    mks123 is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Dec 2014
    Posts
    33
    thanks guys!!

  10. #10
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,800
    I just wanted to how can I use this code/ what is the use of this code.
    I have read that this create shortcut somewhere but never figure out.
    This is not a shortcut to anything. This is a shortcut menu, AKA context menu - like the ones you open when you right click on something.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 6
    Last Post: 07-04-2015, 07:57 PM
  2. Replies: 1
    Last Post: 11-25-2014, 01:42 PM
  3. Unable to create shortcut menu
    By lawdy in forum Programming
    Replies: 36
    Last Post: 05-25-2014, 10:36 AM
  4. Access shortcut?
    By darklite in forum Access
    Replies: 4
    Last Post: 04-11-2011, 10:12 AM
  5. Shortcut & .mdw
    By tbassngal in forum Security
    Replies: 3
    Last Post: 12-06-2010, 02:38 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums