C# MS Word 2010无法打开宏存储

C# MS Word 2010无法打开宏存储,c#,windows,ms-word,C#,Windows,Ms Word,我正在使用Word模板创建Word文档 下面是代码 Word.Document wordDoc = new Word.Document(); wordDoc = wordApp.Documents.Add(ref oTemplatePath, ref oMissing, ref oMissing, ref oMissing); 我收到错误,无法打开宏存储。我应用DCOM安全权限和所有读/写权限 我的服务器是Windows 2008 Professional&IIS 7该模板可能包含一个宏

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

下面是代码

  Word.Document wordDoc = new Word.Document();
 wordDoc = wordApp.Documents.Add(ref oTemplatePath, ref oMissing, ref oMissing, ref oMissing);
我收到错误,无法打开宏存储。我应用DCOM安全权限和所有读/写权限


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

该模板可能包含一个宏。应在Word的宏设置中设置对VBA项目对象模型的信任访问。 看到或


请注意,可以从DCOM更改此设置,但我还没有让它工作。

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

当从模板加载文档但模板不在“受信任”位置时,我看到发生此错误。在指定模板中使用或不使用宏时发生