我已经使用下面的javascript/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;
});