Full Version: Add Hyperlink To Menu
UtterAccess Discussion Forums > Microsoft® Access > Access Q and A
a l e x
Hello Group,

I have created a custom shortcut menu (right-click) for my users; code below:

Dim cmb As Office.CommandBar

Set cmb = Application.CommandBars.Add("myShortcut", msoBarPopup, , True)
With cmb
.Controls.Add msoControlButton, 210, , , True 'sort asc
.Controls.Add msoControlButton, 211, , , True 'sort desc
.Controls.Add(msoControlButton, 21, , , True).begingroup = True 'cut
.Controls.Add msoControlButton, 19, , , True 'copy
.Controls.Add msoControlButton, 22, , , True 'paste
.Controls.Add(msoControlButton, 644, , , True).begingroup = True 'delete record
.Controls.Add(msoControlButton, 1576, , , True).begingroup = True 'insert hyperlink
End With

The code creates a custom shortcut menu visible when my users right-click on an enabled form.

It works well in Access 2003...but when i run the same mdb in 2010, the hyperlink option on the menu is disabled/greyed out.

I'm guessing that i'm using the wrong number (1576) for 2010, but I'm not sure.

I created a test accdb in 2010 just to see what the shortcut menu option was...
On a hyperlink field (is hyperlink = true in form properties) the shortcut menu displays: 'Hyperlink'
and then provides several options: Edit Hyperlink; Open Hyperlink; ... Remove Hperlink.

Does anyone know what msoControlButton number corresponds with 'Hyperlink' so i can display it on my shortcut menu?

I actually ran a function that created a custom ribbon displaying about 2000 shortcut icons with their applicable numbers...
I couldn't find 'Hyperlink' and i'm guesing it's because it doesn't have an icon...

Thanks,
alex
Csharp821
I've never used it, but it sounds like you may know how to implement these. Is this what you needed?

ID Caption Type Enabled Visible
1576 &Hyperlink... Button TRUE TRUE
1577 Edit &Hyperlink... Button FALSE FALSE
1015 &Open Hyperlink Button FALSE FALSE
dipetete
Maybe you can find what you are after for in these files:
http://www.microsoft.com/en-us/download/de...=en&id=6627
a l e x
Thanks for the response!

I'm only looking for the number...

I'm currently using 1576 (and it does not appear to be working in 2010).

1577 and 1015 (as well as 1576) would be 'sub' menu items.

I'm looking for one number that would give me all of the options; i.e., there must be a number which actually designates the 'Hyperlink Menu'; meaning the menu will display 'Hyperlink' and the all the options associated with it.

alex
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.