我正在本地网络上通过IE打开一个Word文档,它能够成功打开,但如果该文档受密码保护,则应提示输入密码,然而并未出现密码提示。
请问我需要采取什么措施才能触发密码提示呢?
我是通过网页上的链接打开文档的,例如:
请问我需要采取什么措施才能触发密码提示呢?
我是通过网页上的链接打开文档的,例如:
<a href="\\path\to\file.doc">Document</a>
<a href="\\path\to\file.doc">Document</a>
我已经使用以下JavaScript/jQuery实现了我想要的功能。 不需要jQuery,我只是因为项目中已经有它而使用它。
$('a.openDoc').live('click',function(){
var file = $(this).attr('href');
// This is what does the work.
try
{
try
{
// get Word Active-X Object if Word is open.
var word = GetObject('',"Word.Application");
}
catch(e)
{
// create new Word Active-X Object.
var word = new ActiveXObject("Word.Application");
}
word.Visible = true; // Make sure Word is visible.
word.Documents.Open(file); // Open the file you want.
}
catch(e)
{
alert(e.description);
}
// End work.
return false;
});
http://www.velocityreviews.com/forums/t109523-open-word-doc-in-word-not-in-browser.html