Javascript and ActiveX word 2000 issue

Discussion in 'Javascript' started by Sylum, Jun 22, 2006.

  1. Sylum

    Sylum Guest

    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.
     
    Sylum, Jun 22, 2006
    #1
    1. Advertising

  2. Sylum

    Randy Webb Guest

    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.

    --
    Randy
    comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
    Temporarily at: http://members.aol.com/_ht_a/hikksnotathome/cljfaq/
    Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
     
    Randy Webb, Jun 22, 2006
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?Z2F1cmF2?=

    Uploading Data From MS Acess 2000 ti SQL server 2000

    =?Utf-8?B?Z2F1cmF2?=, Jan 9, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    814
    Mary Chipman [MSFT]
    Jan 9, 2006
  2. Guest
    Replies:
    2
    Views:
    886
    dave wanta
    Jul 11, 2003
  3. Replies:
    0
    Views:
    883
  4. C Did
    Replies:
    3
    Views:
    3,967
    Chris Lithgow
    Jun 20, 2006
  5. MayBoy
    Replies:
    6
    Views:
    196
    Julian Turner
    Dec 14, 2006
Loading...

Share This Page