提问人:user7391836 提问时间:4/19/2023 最后编辑:Eugene Astafievuser7391836 更新时间:4/19/2023 访问量:47
如何检查撤消按钮是否在 vb.net 中使用单词 vsto 禁用?
How do you check to see if the undo button is disabled using a word vsto in vb.net?
问:
在我Microsoft Word的 vb.net vsto插件中,我正在尝试检查快速访问工具栏中的撤消按钮是启用还是禁用。如果禁用,则表示撤消记录列表为空。
如何检查撤消按钮是否被禁用?
答:
0赞
user7391836
4/19/2023
#1
使用撤消按钮的 ID,您可以检查其启用状态。
Dim isUndoRecordEmpty As Boolean = Application.CommandBars.FindControl(Id:=128).Enabled '128 is the ID for the undo button
If isUndoRecordEmpty = False Then 'if the undo button is disabled, meaning the undo stack is empty
'the undo button is disabled
End If
有关 CommandBar ID 的更多信息,请访问:https://learn.microsoft.com/en-us/office/vba/api/office.commandbarcontrol.id
评论