Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 05-24-2012, 08:12 AM   PM User | #1
trivendra
New to the CF scene

 
Join Date: May 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
trivendra is an unknown quantity at this point
javascript ms word table

I have a file whic is exporting from jsp page to my desktop and I am opening that using javascript.
while i am opening that file I have add a table as header to '.doc' file which was opened as i told earlier.
in that table I have rows and cells.
Now my problem is ...,How can I add value to specific cell using this javascript.I dont want to use,
vb script.please tell me a best solution to this.I am ataching code my code,below.

<script type="text/javascript"> /*to open document by double click on
corresponding ms word document.*/
var objWord;
var objDoc
var objSelection;
var tbl;
objWord = new ActiveXObject("Word.Application");
objDoc = objWord.Documents.Add("http://<%=request.getServerName()+":"+request.getServerPort()%>/qms/loaddoc/<%=docid%>.<%=ftype%>");
objWord.Visible = true;
objSelection = objWord.Selection;
tbl = objDoc.Tables.Add(objWord.Selection.Range,1,4);
var ccell = tbl.cell(1,2).range;
ccell.Font.Bold = false;
ccell.Font.Size = "5";
ccell.innerHTML =objWord.Selection.TypeText("Company Name:"+"<%=Compbean.getCompName()[0]%>");
//objWord.Documents.Open("http://<%=request.getServerName()+":"+request.getServerPort()%>/qms/loaddoc/<%=docid%>.<%=ftype%>");
</script>
trivendra is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:25 PM.


Advertisement
Log in to turn off these ads.