Microsoft Developer Network > Forums Home > Office Live Small Business Forums > Office Live Small Business - Web Site > Office Automation Document.Open() opening doc as Read-Only in ActiveX from Javascript
Ask a questionAsk a question
 

QuestionOffice Automation Document.Open() opening doc as Read-Only in ActiveX from Javascript

  • Tuesday, October 13, 2009 8:20 PMSagana Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    This is the closest forum I can find to Office Automation. I apologise if it is the wrong place for this.

    If I use Word 2007 to open the document on the web server in my office via the network it opens as editable. If I open the same document from IE 8 using

    function editdoc(d) {
        if (browser != 'IE') {
            alert('You must be using Internet Explorer to enable this facility.');
        } else {
            var w=new ActiveXObject('Word.Application');
            var dc = '"'+site+'documents/clients/'+d+'"';
            var docText;
            var obj;
            if (w != null)    {
                w.Visible = true;
                obj=w.Documents.Open(dc);
           
                docText = obj.Content;
                w.ActiveDocument.SaveAs(dc);
       
            }
        }
    }

    it opens the doucment in Word 2007 on the client machine but in Read-Only format. Please let me know how to open the file as editable.