以编程方式选出遗产表格字段
在 MS Word 版本 2202 (2019) 中,我的文档中有一个旧版表单字段(纯文本框),该字段在退出时进行计算,并使用计算结果填充许多其他字段。
我正在寻找一种使用 VBA 跳出该表单字段并触发计算的方法。换句话说,就像用户在表单字段中按下 Tab 键一样,退出该字段,并触发其他字段的计算和填充。
我已经尝试过以下代码:
Selection.TypeText Text:=vbTab
但它不起作用,因为除了填写表格之外,该文档被限制进行编辑。此限制禁止此代码模拟按 Tab 键。
谢谢。
In MS Word version 2202 (2019) I have a legacy form field (a plain text box) in a document that calculates on exit and fills a number of other fields with the result of calculations.
I'm looking for a way to use VBA to tab out of that form field and trigger the calculations. In other words, to function as if the user pressed the tab key when in the form field, exiting from the field, and triggering the calculations and filling of other fields.
I've tried the following code:
Selection.TypeText Text:=vbTab
but it doesn't work because the document is restricted from editing -- other than filling forms. This restriction prohibits this code from emulating pressing the tab key.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
编辑该字段后所需的只是:
All you need after editing the field is: