pdvsa
asked on
Shortcut menu right click - close button is greyed out.
Experts, I am using a rt click short cut menu as shown below. The close button is greyed out though. Does anyone know why? I am using 2007.
thank you
the link is here:
http://msdn.microsoft.com/en-us/library/office/ee336038(v=office.12).aspx
Please see the last commented line that starts with
' Add the Close command.
I have tried a few different reports but the close command is greyed out on all of them. Not sure if there that code was intended for earlier versions of access. All the other selection work except the close option.
thank you
the link is here:
http://msdn.microsoft.com/en-us/library/office/ee336038(v=office.12).aspx
Please see the last commented line that starts with
' Add the Close command.
I have tried a few different reports but the close command is greyed out on all of them. Not sure if there that code was intended for earlier versions of access. All the other selection work except the close option.
Sub CreateReportShortcutMenu()
Dim cmbRightClick As Office.CommandBar
Dim cmbControl As Office.CommandBarControl
' Create the shortcut menu.
Set cmbRightClick = CommandBars.Add("cmdReportRightClick", msoBarPopup, False, True)
With cmbRightClick
' Add the Print command.
Set cmbControl = .Controls.Add(msoControlButton, 2521, , , True)
' Change the caption displayed for the control.
cmbControl.Caption = "Quick Print"
' Add the Print command.
Set cmbControl = .Controls.Add(msoControlButton, 15948, , , True)
' Change the caption displayed for the control.
cmbControl.Caption = "Select Pages"
' Add the Page Setup... command.
Set cmbControl = .Controls.Add(msoControlButton, 247, , , True)
' Change the caption displayed for the control.
cmbControl.Caption = "Page Setup"
' Add the Mail Recipient (as Attachment)... command.
Set cmbControl = .Controls.Add(msoControlButton, 2188, , , True)
' Start a new group.
cmbControl.BeginGroup = True
' Change the caption displayed for the control.
cmbControl.Caption = "Email Report as an Attachment"
' Add the PDF or XPS command.
Set cmbControl = .Controls.Add(msoControlButton, 12499, , , True)
' Change the caption displayed for the control.
cmbControl.Caption = "Save as PDF/XPS"
' Add the Close command.
Set cmbControl = .Controls.Add(msoControlButton, 923, , , True)
' Start a new group.
cmbControl.BeginGroup = True
' Change the caption displayed for the control.
cmbControl.Caption = "Close Report"
End With
Set cmbControl = Nothing
Set cmbRightClick = Nothing
End Sub
http://www.tutcity.com/access/custom-menu-partially-grayed-out-in-runtime-mode.77251.html
in runtaime ,it's msaccess runtime property
ASKER
Not following... What i read was that the greyed out close button is due to "runtime" version of access? Not sure if that is what you are saying. Let me know
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
that was exactly the solution to my problem. Thanks.