Javascript and ActiveX word 2000 issue

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.
 
R

Randy Webb

Sylum said the following on 6/22/2006 4:53 AM:
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 ?

Maybe because Word 2000 has no concept of opening a file from a web server.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top