从 Intranet 上的 Internet Explorer 打开 Word 文档
我们有一个用于文档管理的内部网站。当您选择打开文档时,它会运行以下脚本来打开该文件:
<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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试在 IE 中允许所有类型的脚本。我相信有一些关于宏的东西......
Try allowing all kind of scripts in IE. I believe there was something about macroses...
我猜这个问题与 IE 的安全设置有关。
I guess the issues is reated to Security setting of IE.