Excel 自定义 UI Microsoft Office 可调整大小按钮的编辑器

Excel Custom UI Editor For Microsoft Office Resizable buttons

我正在尝试根据 window 的大小在 Excel 中使用可调整大小的按钮创建自定义功能区选项卡。我正在使用 Microsoft Office 的自定义 UI 编辑器。我希望当我缩小 Excel 时按钮会变小,就像在其他选项卡中一样。下面是我在 Custom UI Editor For Microsoft Office 中编写的代码。这里的大小被定义为大。是否可以将其设置为自动,以便它会根据 window 的大小自动更改?

<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
    <ribbon>
        <tabs>
            <tab id="CustomTab" label="Custom Tab" insertAfterMso="TabView">
                <group id="ImportRequestGroup" label="Import Requests" imageMso="Refresh">
                    <button id="RefreshButton" label="Refresh" size="large" onAction="RefreshAction" imageMso="Refresh" />
                    <button id="ImportRequestButton" label="Import Requests" size="large" onAction="ImportRequestAction" imageMso="OutlineDemoteToBodyText" />
                </group>
                <group id="ShowViewsGroup" label="Show views" imageMso="FrameCreateLeft">
                    <button id="ShowCalanderButton" label="Show Calander" size="large" onAction="ShowCalanderAction" imageMso="FrameCreateLeft" />
                    <button id="ViewPlanButton" label="View Plan" size="large" onAction="ViewPlanAction" imageMso="ViewFullScreenView" />
                    <button id="SortPlanButton" label="Sort Plan" size="large" onAction="SortPlanAction" imageMso="Bullets" />
                    <button id="FilterNoneButton" label="Filter none" size="large" onAction="FilterNoneAction" imageMso="FilterToggleFilter" />
                    <button id="HideAbsenceButton" label="Hide Absence" size="large" onAction="HideAbsenceAction" imageMso="CharacterBorder" />
                </group>
                <group id="ManageRowsGroup" label="Manage rows" imageMso="ActionInsertAccess">
                    <button id="InsertRowButton" label="Insert Row" size="large" onAction="InsertRowAction" imageMso="ActionInsertAccess" />
                    <button id="MoveToArchaveButton" label="Move to Archave" size="large" onAction="MoveToArchaveAction" imageMso="SourceControlCheckOut" />
                </group>
                <group id="EmailReportsGroup" label="Email reports" imageMso="ChangesDiscardAndRefresh">
                    <button id="CalculateDifferenceButton" label="Calculate Difference" size="large" onAction="CalculateDifferenceAction" imageMso="ChangesDiscardAndRefresh" />
                    <button id="DaysReminderButton" label="5 days Reminder" size="large" onAction="DaysReminderAction" imageMso="MailMergeStartEmail" />
                </group>
                <group id="ReportsGroup" label="Reports" imageMso="AcceptInvitation">
                    <button id="ApprovePlanButton" label="Approve Plan" size="large" onAction="ApprovePlanAction" imageMso="AcceptInvitation" />
                    <button id="Report14DaysButton" label="Report 14 days" size="large" onAction="Report14DaysAction" imageMso="ChooseForm" />
                    <button id="ReportTechnicianButton" label="Report Technician" size="large" onAction="ReportTechnicianAction" imageMso="CompareAndCombine" />
                    <button id="WeeklyViewButton" label="Weekly View" size="large" onAction="WeeklyViewAction" imageMso="GroupMarginsAndPadding" />
                </group>
                <group id="CheckDuplicatesGroup" label="Check duplicates" imageMso="OutlineUngroupMenu">
                    <button id="CheckEquipmenButton" label="Check Equipmen" size="large" onAction="CheckEquipmenAction" imageMso="OutlineUngroupMenu" />
                    <button id="CheckTechnicianButton" label="Check Technician" size="large" onAction="CheckTechnicianAction" imageMso="SharingOpenWssTaskList" />
                </group>
                <group id="SpotfireFilesGroup" label="Spotfire files" imageMso="Chart3DColumnChart">
                    <button id="SpotfirePlanAndArchiveButton" label="Spotfire Plan and Archive" size="large" onAction="SpotfirePlanAndArchiveAction" imageMso="Chart3DColumnChart" />
                    <button id="SpotfireRealizationReportButton" label="Spotfire Realization Report" size="large" onAction="SpotfireRealizationReportAction" imageMso="SharingOpenWssContactList" />
                </group>
                <group id="FormatingGroup" label="Formating" imageMso="AutoFormat">
                    <button id="ConditionalFormatingButton" label="Conditional Formating" size="large" onAction="ConditionalFormating" imageMso="AutoFormat" />
                </group>
            </tab>
        </tabs>
    </ribbon>
</customUI>

我试图在网上找到解决方案,但没有成功。

调整自定义控件大小仅适用于 Office 2010 及更高版本。自定义控件的功能有些受限(与 Microsoft 对自己的控件所做的相反)。

该功能只能应用于 group 控件,不能应用于单个控件。该命令是 <group> 标签的一个属性。示例:

<group id="ImportRequestGroup" autoScale="true" label="Import Requests" imageMso="Refresh">

微软文档参考: https://docs.microsoft.com/en-us/previous-versions/office/developer/office-2010/ee691834(v=office.14)?redirectedfrom=MSDN#auto-scaling-of-custom-controls