Looking to proofread an XML document using Interop

C

Chris

Hello,

I am currently using Microsoft.Office.Interop.Word (2003) functionality to
spellcheck an XML document in memory. However, Word by default proofreads the
whole thing, tags and all.

For those who are familiar with Interop, here is some of the code:

wordDoc.Content.Text = page.Text;
for (int i = wordDoc.Words.Count - 1; i > 0; i--)
{
Range x = wordDoc.Words;
if (x.SpellingErrors.Count > 0)
{
_spellingSuggestions = x.GetSpellingSuggestions(ref t, ref t, ref t, ref
t, ref t, ref t, ref t, ref t, ref t, ref t, ref t, ref t, ref t);
if (_spellingSuggestions.Count > 0)
{
bool addSpace = x.Text.EndsWith(" ");
//Yes, there are one or more suggestions. You can grab the first
//suggested spelling by referencing:
x.Text = _spellingSuggestions[1].Name + (addSpace ? " " : "");
}
}
}

(t is nothing)

I'm not sure how to get the spellcheck to work around the XML markup.
Any help would be fantastic. Thanks!

-Chris
 
Top