【问题标题】:How to open a word document without resolving the attached template?如何在不解析附加模板的情况下打开word文档?
【发布时间】:2011-10-20 18:26:54
【问题描述】:

由于从 Office 2000 迁移到 Office 2010,我的单词模板名称已更改(从 *.dot 到 *.dotm)。现在我想更新现有文档中指定的附加模板的声明。 我编写了一个映射“旧”和“新”模板名称的小程序,但在检索旧模板名称时遇到了麻烦。 使用Documents.open() 打开文档时,找不到指定的附加模板,因此默认应用 Normal.dotm 并且我的映射不起作用。我没有找到关闭附加模板自动解析的方法。 奇怪的行为:打开文档后,可以在文档属性中看到原始模板名称,但 ?ActiveDocument.AttachedTemplate 是 'Normal.dotm'

【问题讨论】:

    标签: vba ms-word ms-office


    【解决方案1】:

    试试这个:

    MsgBox Dialogs(wdDialogDocumentStatistics).Template
    

    【讨论】:

    • Dialogs(wdDialogDocumentStatistics).Template 包含文档创建后的模板路径。有了这些信息,我的映射现在可以工作了。谢谢。顺便说一句:Word 查找文档模板 1. 创建位置 2. 保存文档的文件夹 3. 用户/工作组模板的指定文件夹
    猜你喜欢
    • 2023-03-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-06-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多