PDA

View Full Version : How to Insert MS Excel Inside MS Word


vetrivel
23rd October 09, 09:13 AM
In MS Word there will be a Option

Insert --> Object --> Create From File

to attach the Existing Document in MS Word

I need this process to be done with JavaScript
I have Opened the MS Word using the Following Code


var word = new ActiveXObject('Word.Application');
var docText,obj;
if (word != null)
{
word.Visible = false;
obj=word.Documents.Open("D:\\Folder Name\\FileName.doc");
docText = obj.Content;
var Document=word.ActiveDocument;
word.Documents.Save();
word.Quit();
}


I dont know or didnot get Idea how to do it
This Process is Done is Local System only not in any server

Thanks in Advance

chrishirst
23rd October 09, 09:25 AM
It's NOT javascript!

It is VBA (Visual Basic for Applications) or VBScript you need to use.

vetrivel
23rd October 09, 09:56 AM
Hai chrishirst,

I needed to know whether this can be done using javascript or not?

chrishirst
23rd October 09, 03:27 PM
javascript runs in a WEB BROWSER context


WHY would you open a browser to insert a excel document into a word document ?????????

vetrivel
27th October 09, 11:39 AM
This Process is to be Done Dynamically with the input file from the upload field and to attach in the Excel

chrishirst
27th October 09, 09:44 PM
So it needs to be done server side then?