如何访问 Word 2007 VBA 中的某种 OnLoad 事件?
我试图在首次加载文档时触发一些代码,但有两个问题。 首先,我不知道首次打开文档时要调用哪个方法来触发某些内容。 其次,如果它们禁用了宏,我如何确保它们在启用时被调用?
谢谢!
I am trying to have some code fire when the document is first loaded, but there are two problems. First, I don't know which method to call to get something to fire when the document is first opened. Second, if they have macros disabled, how can I be sure that it gets called when they are enabled?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首次加载文档时会发送
Document_Open
事件。 要使用它,请在ThisDocument
的 VBA 代码中输入以下内容:至于禁用的宏,我不知道启用宏后会立即调用的方法。
The
Document_Open
event is sent when your document is first loaded. To make use of it, enter the following in the VBA code forThisDocument
:As for the disabled macros, I'm not aware of a method that will be called as soon as macros are enabled.