I have an HTML page that has a link to open Microsoft Word on the local machine. The code runs fine while I am running in .NET. Once it is published to a server, ActiveXObject fails without returning any message or Inner Exception.
Has anyone else encountered this before. Since this is running at the client in javascript, I don't understand why it would fail.
function WordCallback(filename) {
var word;
try {
word = new ActiveXObject("Word.Application"); //fails here
}
catch (e) {
$.colorbox.close();
alert('This functionality only works with Internet Explorer.');
return false;
}
try {
//open the document using word
word.Documents.Open(filename);
word.Visible = true; // Make sure Word is visible.
word.Activate();
}
catch (e) {
alert('Unable to open the document.');
}
return false;
}
Its most likely failing because
ActiveXObject's
to be createdThe most likely error is that your server/site is not trusted by the browser. See Allowing ActiveXObject for a trusted site or http://support.microsoft.com/kb/832512