如何自动“从 XYZ 模板重置为快速样式” 在Word 2007 中?

发布于 2024-07-12 22:01:54 字数 247 浏览 8 评论 0原文

在 Word 2007 中,用户可以通过在“更改样式”菜单选项中选择“从 XYZ 模板重置为快速样式”来更新应用的样式。

从 XYZ 模板重置为快速样式

有谁知道自动执行此操作的方法吗? 我尝试向模板项目的 VBA 中的 Document_Open() 方法添加宏,但出现错误。

In Word 2007, a user may update the applied styles by selecting the "Reset to Quick Styles from XYZ Template" in the Change Styles menu option.

Reset to Quick Styles from XYZ Template

Does anyone know of a way to automate this? I tried adding a macro to the Document_Open() method in the VBA for the Template project, but it errors out.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

久而酒知 2024-07-19 22:01:54

当您录制“从 xxx 模板重置为快速样式”的宏时,Word 会生成 VBA 代码:

WordBasic.ApplyQFSetTemplate

我也无法让此命令工作,也找不到任何有关它的 Word VBA 文档。 相反,请在附加正确的模板后使用以下命令:

ActiveDocument.UpdateStyles

该命令确实可以一致地工作!

When you record a macro of the 'Reset to Quick Styles from xxx Template', Word generates the VBA code:

WordBasic.ApplyQFSetTemplate

I couldn't get this command to work either, nor find anything Word VBA docs about it. Instead, use the following command when the correct template is attached:

ActiveDocument.UpdateStyles

That one does work consistently!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文