MS Word 2010 无法打开宏存储

问题描述 投票:0回答:3

我正在使用Word模板创建Word文档

以下是代码

  Word.Document wordDoc = new Word.Document();
 wordDoc = wordApp.Documents.Add(ref oTemplatePath, ref oMissing, ref oMissing, ref oMissing);

我收到错误无法打开宏存储。我申请了 DCOM 安全权限和所有读/写权限。

我的服务器是 Windows 2008 Professorial & IIS 7

c# ms-word
3个回答
0
投票

模板可能包含宏。您应该在 Word 的宏设置中设置信任对 VBA 项目对象模型的访问。 请参阅 http://support.microsoft.com/kb/282830/en-ushttp://support.microsoft.com/kb/303872/en-us

注意,有可能从 DCOM 更改此设置,但我还没有成功。


0
投票

对我来说,它在通过主机名而不是 IP 地址访问时有效。模板位于网络共享上。


0
投票

我见过当从模板加载文档但该模板不在“受信任”位置时会发生此错误。在指定模板中有或没有宏都会发生。

© www.soinside.com 2019 - 2024. All rights reserved.