How can I launch Word with a document path from activeX like for example:
function RunWord(cmdline, args){
var v;
v = new ActiveXObject("Shell.Application");
v.ShellExecute(cmdline+" "+args);
}
w开发者_运维问答here cmdline is 'Word' that is a shortcut link in one of the system folder and args is the path to file like 'C:\Projects\Schedule.doc'
The problem is it combine the string like 'Word C:\Projects\Schedule.doc' and then give an error saying it does not find this application, however when I launch word alone without args it works ok.
Any ideas ?
Do you need to escaped the backslashes in your filename? I.e. use
'C:\\Projects\\Schedule.doc'
instead of
'C:\Projects\Schedule.doc'
精彩评论