S
Sylum
Hi everyone,
I'm coding an web application with Javascript and ActiveXWord 2000.
Basicly, on the client side, i use javascript to create an instance
Word 2000 in order to have a new document from template (.dot) located
on my serveur. When the application run i get an error. In fact, the
problem come when i put an URL like
"http:////myserveur///Modeles//Template.dot" into my method
"app_word.Documents.add(URL)" but if i use a classic path like
"C:\\temp\\Template.dot" the application work fine. Please Any
suggestion ?
by the way, with the active word 2003 i get no problem at all even with
the URL.
Below a piece of my code :
function opendoc(){
if (window.ActiveXObject) {
try {
var app_word = new ActiveXObject("Word.Application");
var doc_word = new ActiveXObject("Word.Document");
} catch (e) {} }
if (!app_word) {
alert('Abandon : Impossible de créer une instance
Word.Application.');
return false;
}
else
{
// var oPathTemplate = "C:\\temp\\Template.dot"
var oPathTemplate = "http:////myserveur///Modeles//Template.dot"
try {
/* Add document */
doc_word = app_word.Documents.add(oPathTemplate);
if (!doc_word) {
alert('Abandon : Impossible de créer un document Word.');
app_word.Quit(0);
return false;
}
/* Activation document */
doc_word.Activate();
/* Make it visible*/
app_word.Application.Visible = true;
}
}
tnx in advance,
Cedric.
I'm coding an web application with Javascript and ActiveXWord 2000.
Basicly, on the client side, i use javascript to create an instance
Word 2000 in order to have a new document from template (.dot) located
on my serveur. When the application run i get an error. In fact, the
problem come when i put an URL like
"http:////myserveur///Modeles//Template.dot" into my method
"app_word.Documents.add(URL)" but if i use a classic path like
"C:\\temp\\Template.dot" the application work fine. Please Any
suggestion ?
by the way, with the active word 2003 i get no problem at all even with
the URL.
Below a piece of my code :
function opendoc(){
if (window.ActiveXObject) {
try {
var app_word = new ActiveXObject("Word.Application");
var doc_word = new ActiveXObject("Word.Document");
} catch (e) {} }
if (!app_word) {
alert('Abandon : Impossible de créer une instance
Word.Application.');
return false;
}
else
{
// var oPathTemplate = "C:\\temp\\Template.dot"
var oPathTemplate = "http:////myserveur///Modeles//Template.dot"
try {
/* Add document */
doc_word = app_word.Documents.add(oPathTemplate);
if (!doc_word) {
alert('Abandon : Impossible de créer un document Word.');
app_word.Quit(0);
return false;
}
/* Activation document */
doc_word.Activate();
/* Make it visible*/
app_word.Application.Visible = true;
}
}
tnx in advance,
Cedric.