excel - 用于 Microsoft Office 可调整大小按钮的 Excel 自定义 UI 编辑器
问题描述
我正在尝试根据窗口的大小在 Excel 中使用可调整大小的按钮创建自定义功能区选项卡。我正在为 Microsoft Office 使用自定义 UI 编辑器。我希望缩小 Excel 时按钮会变小,就像在其他选项卡中一样。我在 Microsoft Office 的自定义 UI 编辑器中编写的代码如下。这里大小被定义为大。是否可以将其设置为自动,以便它会根据窗口的大小自动更改?
<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">
推荐阅读
- powershell - 带有空格的批处理脚本用户输入
- python - 为什么列表可以用作 sorted() 的“关键”参数?
- php - 如果它们确实从选项中禁用它们,您如何检查时间是否存在于两个数组中
- oracle - Oracle:行级触发器将行插入表并更新另一个表的列
- reactjs - React-Select 失去自定义组件“ValueContainer”的焦点
- dask - dask to_dataframe 重复索引
- javascript - 通过传递参数更新 `[].forEach.call()` 中的值
- python - seaborn 的 lmplot 的输出没有绘制散点图和线性回归
- java - Java中的线程和计算
- arduino - 如何修复 arduino MKR 1010 不打印到串行