Hi =?Utf-8?B?dHV0dQ==?=,
[Quoted Text] > Does PIA require administrator privilege as PIA interact with COM
objects? > No, that's certain. I'm not sure what's happening, here...
If you try something more like this: Word.Range rng = doc.Sentences[i]; //Sentence object returns a range
Do you see anything different?
> It's weird when I debug my app. > for instance, > -------- > Word doc=null; > .....(opens the document) > > for(int i=0;i<doc.Sentences.Count;i++){ > object start = doc.Sentences[i].Start; > object end = doc.Sentences[i].End; > > Word.Range rng = doc.Range(ref start, ref end); > rng.Select(); > } > --------- > I see doc.Sentences.Count=7, but when code runs next: > object start = doc.Sentences[i].Start; > It just throws an exception: > " The requested member of the collection does not exist. at > Microsoft.Office.Interop.Word.Sentences.get_Item(Int32 index)..." > > But the document does have multiple sentences. Why does this happen? >
Cindy Meister INTER-Solutions, Switzerland http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005) http://www.word.mvps.org
This reply is posted in the Newsgroup; please post any follow question or reply in the newsgroup and not by e-mail :-)
|