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
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