RossWaddell
New member
- Local time
- Today, 11:34
- Joined
- Jul 24, 2016
- Messages
- 6
I've used a list of available menubar control IDs for making my own shortcut menus in Access 97/2003 before, but I can't seem to find the same thing for Access 2016. I've looked through 'accesscontrols.xlsx' (Office 2016 UI Help Files) downloaded from the Microsoft site, but can't locate the items highlighted in the attached photo - can anyone help me find the IDs? I've attached a zip file with my screenshots as I've not yet reached 10 posts.
(Note that the 'Close' item works on my custom shortcut but doesn't look the same as the one from the out-of-the-box report shortcut)
And here's the code I'm using to create my custom report shortcut:
(The ones commented out are what I thought were the right items, but they threw an error)
(Note that the 'Close' item works on my custom shortcut but doesn't look the same as the one from the out-of-the-box report shortcut)
And here's the code I'm using to create my custom report shortcut:
Code:
Public Function AddCustomPrintPreviewShrtCutMenu()
' Create custom print preview shortcut menu
Dim cbar As CommandBar
Dim cbarCtrl As CommandBarControl
On Error Resume Next
CommandBars("Wfest PrntPrevShrtCut").Delete
On Error GoTo GEH
Set cbar = CommandBars.Add("Wfest PrntPrevShrtCut", msoBarPopup)
' (1) Add "Zoom"
' Set cbarCtrl = cbar.Controls.Add(Type:=msoControlDropdown, ID:=15993)
' (2) Add "One Page" toggle
' Set cbarCtrl = cbar.Controls.Add(ID:=5) Works, but not needed if the Zoom & Multiple Pages can't be added
' (3) Add "Multiple Pages >"
' Set cbarCtrl = cbar.Controls.Add(Type:=msoControlPopup, ID:=15069)
' (4) Add "Page Setup..."
Set cbarCtrl = cbar.Controls.Add(ID:=247)
' With cbarCtrl
' .BeginGroup = True
' End With
' (5) Add "Print..."
Set cbarCtrl = cbar.Controls.Add(ID:=15948)
' (6) Add "Save As..."
Set cbarCtrl = cbar.Controls.Add(ID:=748)
With cbarCtrl
.BeginGroup = True
End With
' (7) Add "Close"
Set cbarCtrl = cbar.Controls.Add(ID:=923)
With cbarCtrl
.BeginGroup = True
End With
Exit_Function:
Set cbarCtrl = Nothing
Set cbar = Nothing
Exit Function
GEH:
MsgBox Str(Err.Number) & ": " & Err.Description, vbOKOnly + vbCritical, APP_TITLE & " - AddCustomPrintPreviewShrtCutMenu()"
Resume Exit_Function
End Function
(The ones commented out are what I thought were the right items, but they threw an error)