P
philipl
hi
I am using the word DOM to do some grammar checking. With big docs it
takes a long time. I have managed to improve performance by for
example limiting file I/O and opening only the word app just once for
all documents. Just wondering about the efficency of the below code:
Word.ApplicationClass WordApp = new Word.ApplicationClass();
Word.Range wr = WordApp.Selection.Range;
gramcount = wr.GrammaticalErrors.Count;
for(i=1;i<=gramcount;i++)
{
errorword = wr.GrammaticalErrors.Item(i).Text.ToString();
}
I am assuming that the DOM I am accessing is already in memory and all
info has been filled already. Is this correct? It seems to take less
than a milli second to access the count property but it takes over one
milli second to go throught the loop. Is there anymore I can do to
improve this?
Cheers
I am using the word DOM to do some grammar checking. With big docs it
takes a long time. I have managed to improve performance by for
example limiting file I/O and opening only the word app just once for
all documents. Just wondering about the efficency of the below code:
Word.ApplicationClass WordApp = new Word.ApplicationClass();
Word.Range wr = WordApp.Selection.Range;
gramcount = wr.GrammaticalErrors.Count;
for(i=1;i<=gramcount;i++)
{
errorword = wr.GrammaticalErrors.Item(i).Text.ToString();
}
I am assuming that the DOM I am accessing is already in memory and all
info has been filled already. Is this correct? It seems to take less
than a milli second to access the count property but it takes over one
milli second to go throught the loop. Is there anymore I can do to
improve this?
Cheers