>Hi all,
>
[quoted text clipped - 13 lines]
>
>Avraham Makeler
Hi Avraham,
Look at http://word.mvps.org/FAQs/MacrosVBA/GetIndexNoOfPara.htm,
which shows how to get the index number of the current member of any
collection that has a .Count property.
--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Avi Mak - 18 Jul 2005 07:37 GMT
Thanks, Jay.
You managed to answer faster than I could jump in and answer my own
question. I had made one further search and found the following answer:
ActiveDocument.Range(0, Selection.Range.End).Sentences.Count
(in the name of Doug Robbins - Word MVP)
which is the same idea as the answer you refer to.
I am a programmer of many years experience, but a relative beginner at
VBA. I am surprised that obtaining a sentence/para/word index index is
so convoluted. I would guess that this solution requires a lot of CPU
time, and indeed this seems to be borne out in practice. I have written
a progress bar, and it severely slows down the processing of the
document. It runs a lot faster without the progress bar, but I DO want
the progress bar. Ok, so I decide to recalculate and display it only
every 5 or 10 times, so that helps - just makes it look a bit jumpy.
Thanks.
Avraham.
Avi Mak - 18 Jul 2005 11:01 GMT
Ok, I tried it. It is just tooo slow - it takes longer than the time
needed to process the document ...! The PCs I have at my place of work
are too slow to take this. (The company buys cheapo whenever it can -
low MegaHertz, Narrow buses, small caches, etc. My own PC at home is a
2.8GHz FULL. And it blazes. But I am not at home; I am at work.)
Anybody have any better ideas how to get the line/para/sentence?
Avraham.