JavaScript Word Automation

T

tom.chakam

Hi,

I'm trying to write a small html application that reads synonyms,
antonyms, and meanings from Word using JavaScript. I've been able to
automate the Word object. However I don't know how to get data out of
the objects synInfo.AntonymList, SynonymList, and MeaningList. I think
they are supposedly a VARIANT array of BSTR. How do I get data out of
these objects?

Here is my code:
<HTML>
<HEAD>
<TITLE>MSWORD App through JavaScript</TITLE>
</HEAD>
<BODY>
<script>
var word = new ActiveXObject('Word.Application');
var doc;
var selection;
var range;

if (word != null)
{
debugger;
word.Visible = true;
word.Documents.Add();
selection = word.Selection;
selection.Text = "Good";
range = selection.range;
var synInfo = range.SynonymInfo;
var antonyms = synInfo.AntonymList;
var synList = synInfo.SynonymList(1);
word.Quit();
}

</script>

</BODY>
</HTML>



Thank you
 

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