从 Intranet 上的 Internet Explorer 打开 Word 文档

发布于 2024-09-17 17:13:31 字数 858 浏览 2 评论 0原文

我们有一个用于文档管理的内部网站。当您选择打开文档时,它会运行以下脚本来打开该文件:

<a href="javascript:opendokument('P:\\01\\2-010-01.doc')">012-010-01</a> 

<SCRIPT language=javascript>  
function opendokument(dokument){ 
var objAppl;

try{ 
    objAppl = GetObject("","Word.Application"); 
    objAppl.Documents.open(dokument); 
} 
catch(exception){ 
    objAppl = new ActiveXObject("Word.Application"); 
    objAppl.Visible = true; 
    objAppl.Documents.open(dokument); 
}    
objAppl = null;  
} 
</script> 

问题是,当我们从带有 Office 2003 的 Windows XP 迁移到带有 Office 2007 的 Windows 7 时,文档中的宏现在无法正确运行(请参阅< a href="https://stackoverflow.com/questions/3600272/access-active-document-in-vba-when-document-is-opening">我之前的帖子)

如果我在本地运行脚本我的电脑或者如果我手动打开文档,宏可以正常工作。我该如何让它发挥作用?我可以在 Word 或 Internet Explorer 中进行的任何设置,或者我可以在打开文档的网站上重写脚本。

We have an internal website for document management. When you choose to open a document, it run the following script to open the file:

<a href="javascript:opendokument('P:\\01\\2-010-01.doc')">012-010-01</a> 

<SCRIPT language=javascript>  
function opendokument(dokument){ 
var objAppl;

try{ 
    objAppl = GetObject("","Word.Application"); 
    objAppl.Documents.open(dokument); 
} 
catch(exception){ 
    objAppl = new ActiveXObject("Word.Application"); 
    objAppl.Visible = true; 
    objAppl.Documents.open(dokument); 
}    
objAppl = null;  
} 
</script> 

The problem is that the macros in the document is not running correctly now as we move from Windows XP with Office 2003 to Windows 7 with Office 2007 (See my previous post)

If I run the script locally on my computer or if I open the documents manually macros work properly. How do I get this to work? Any setting I can do in Word or Internet Explorer, or can I rewrite the script on the site that open documents.

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

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

发布评论

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

评论(2

墨离汐 2024-09-24 17:13:31

尝试在 IE 中允许所有类型的脚本。我相信有一些关于宏的东西......

Try allowing all kind of scripts in IE. I believe there was something about macroses...

情未る 2024-09-24 17:13:31

我猜这个问题与 IE 的安全设置有关。

I guess the issues is reated to Security setting of IE.

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