May 11 2020 12:45 PM
I need to address two related issues in the following Custom UI for (32-Bit) Access 2016 on (64-Bit) Windows 10:
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
<ribbon startFromScratch="true"/>
<backstage>
<!-- Hide Home tab. -->
<tab idMso="PlaceTabHome" visible="false"/>
<!-- Hide New tab. -->
<tab idMso="TabOfficeStart" visible="false"/>
<!-- Hide Open tab. -->
<tab idMso="TabRecent" visible="false"/>
<!-- Hide Info tab. -->
<tab idMso="TabInfo" visible="false"/>
<!-- Hide Save Database As task on Save As tab. -->
<tab idMso="TabSave">
<firstColumn>
<taskFormGroup idMso="SaveGroup">
<category idMso="FileTypes">
<task idMso="SaveDatabaseAs" visible="false"/>
</category>
</taskFormGroup>
</firstColumn>
</tab>
<!-- Hide all but Print Preview task on Print tab. -->
<tab idMso="TabPrint">
<firstColumn>
<taskGroup idMso="GroupPrint">
<category idMso="PrintCategory">
<!-- Hide Quick Print task on Print tab. -->
<task idMso="FilePrintQuick" visible="false"/>
<!-- Hide Print Dialog task on Print tab. -->
<task idMso="PrintDialogAccess" visible="false"/>
</category>
</taskGroup>
</firstColumn>
</tab>
<!-- Hide Close button. -->
<button idMso="FileCloseDatabase" visible="false"/>
<!-- Hide Account tab. -->
<tab idMso="TabHelp" visible="false"/>
<!-- Hide Feedback tab. -->
<tab idMso="TabOfficeFeedback" visible="false"/>
<!-- Hide Privacy Options button. -->
<button idMso="ApplicationOptionsDialog" visible="false"/>
</backstage>
</customUI>
When a database opens using the above, its Backstage displays the following, which seems correct:
If the user opens an object (say, a Query Definition), then it displays the following, which also seems correct:
If the user closes the database object, however, the Backstage does not revert to Screen Shot A, as I would expect.
Additionally, if the user then clicks the "Save As" button -- with no database object open -- the following error message displays:
Issue #1: How do I get the Backstage to revert from Screen Shot B to Screen Shot A without closing/reopening the database -- or otherwise avoid the error -- when no database object is open?
(I assume my Custom UI is incomplete and/or conceptually flawed.)
Issue #2: How do I hide the "Advanced" option ("Save As Client Object"), which is grayed-out and unavailable -- but still visible -- in Screen Shot B?
I find a "SaveAsClientObject" entry in the "AccessControls.xlsx" file (from the Office 2016 Fluent User Interface Control Identifier download), which I assume corresponds to this button. I cannot figure out where to put it, however, by simply reviewing the API Reference for the CustomUI Namespace.
My naive interpretation of Custom UI elements in Screen Shot B is:
AFAIK, a Custom UI to hide the "Advanced" option "Save As Client Object" would look like this:
<!-- Modify "Save As" tab. -->
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
<backstage>
<tab idMso="TabSave">
<firstColumn>
<taskFormGroup idMso="SaveGroup">
<category idMso="FileTypes">
<!-- Hide "Save Database As" task. -->
<task idMso="SaveDatabaseAs" visible="false"/>
<!-- Hide "Save As Client Object" button in "Save Object As" task. -->
<task idMso="SaveObjectAs">
<group idMso="GroupSaveObject">
<!-- AT LEAST ONE UNKNOWN WRAPPER NODE BEGINS HERE. -->
<!-- <button idMso="SaveAsClientObject" visible="false"/> GOES HERE -->
<!-- AT LEAST ONE UNKNOWN WRAPPER NODE ENDS HERE. -->
</group>
</task>
</category>
</taskFormGroup>
</firstColumn>
</tab>
</backstage>
</customUI>
I cannot figure out, however, what nodes wrap the Save As Client Object button within the Save Object group. A "topItems" node? A "layoutContainer" node? Something else? Beats me.