MS Office 应用程序有一个 incredible API允许执行任何可从 UI 访问但无法从对象模型访问的命令。具体可以用ExecuteMso()执行任何命令按钮、切换按钮或拆分按钮。文档说:
expression.GetEnabledMso(idMso)
idMso - Identifier for the control (String)
是否在任何地方记录了字符串命令代码? Office 应用程序有数以千计的独特命令,可以在“选项”对话框中查看这些命令,最好能引用所有这些命令的字符串代码。
请您参考如下方法:
有这些:
Office 2007:Lists of Control IDs
Office 2010:Office Fluent User Interface Control Identifiers
Office 2013:Office Fluent User Interface Control Identifiers
