FormattedText into Excel cell

J

jic

Greetings.

I have been tasked with some serious work. I have figured out most of
it, but I am lacking two things:
1. How to copy into an Excel cell the formatted text that is in a
Word Table cell
2. Paste that Excel cell back into that same Word Table

I have figured out the way to know the excel Word Table cell, that-s
the easy part. The problem is that the assignment of the Word into
the Excel comes as a text. I need to keep the HTML formatting in the
assignment to excel because I am going to translate that excel and
paste it back translated. It-s a long story, there are cells that do
not get translated. Anyway, here is what I have in JScript:
var doc = word.Documents.Open(file);
var myRange = doc.Range(0,0);
var table = 1;
var t = doc.Tables.item(table);
var cell = 1;
var wc = t.Range.Cells.item(cell);
xl.WorkBooks.Add;
xl.Cells(r,c).Value = wc.Range.FormattedText;

I-ve also tried Text and same thing.

xl.Cells(r,c).Text = wc.Range.FormattedText;

Any help would be greatly appreciated. also, if anyone knows how to
do this, then, also help me get it back to Word.

thanks,

josé
 

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

Top