Thanks for the response.

> I get the answer 27785 in a second.
For me, that's terrible. I need to display the progress of many hundreds or
even thousands of hits. Even if I only call the progress bar once every 10
hits this is still an unacceptable overhead --- and I will also get a jumpy
bar.

Thanks.

Avraham.

(Btw, greetings from Israel.)

>> same with sentences
Well, I am sure that counting sentences does not work very well on our
machines, so if paras and words take as long then they also won't work.
Maybe I will get around to trying them later.

Thanks.

Avraham.

Helmut Weber wrote:
> Hi Avi,
>
> 1 GHz, 768 MB Ram, 200 pages document,
> insertion point on the last page
>
> MsgBox ActiveDocument.Range(0, Selection.Range.End).Words.Count
>
> I get the answer 27785 in a second.
>
> Same with paragraphs, same with sentences.
>
> Processing lines is something completely different,
> they depend on e.g. pagesetup, printer, font etc.
>
> > ActiveDocument.Range(0, Selection.Range.End).Sentences.Count
>
> convoluted?
>
> How about this one, which is essentially the same.
> Just a bit easier to read, maybe.
>
> Dim rDcm As Range
> Set rDcm = ActiveDocument.Range
> rDcm.End = Selection.Range.End
> MsgBox rDcm.Words.Count
>
>
> Greetings from Bavaria, Germany
>
> Helmut Weber, MVP, WordVBA
>
> Win XP, Office 2003
> "red.sys" & Chr$(64) & "t-online.de"

Re: Need Index # of current line/para/word [cont. after delay] by Jonathan

Jonathan
Thu Jul 21 10:36:29 CDT 2005

Hi Avraham,

In that case, I recommend that you base the progress bar on the
Selection.End property. You are counting characters rather than sentences,
but what you are looking for (if i understand your requirements correctly)
is a rough guide as to the percentage of the document that you have
completed. Comparing Selection.End with ActiveDocument.Range.End should
provide you with a perfectly adequate measure of progress.

--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org

"Avraham Makeler" <amakeler@bezeqint.net> wrote in message
news:42df63bc@news.bezeqint.net...
> Thanks for the response.
>
>> I get the answer 27785 in a second.
> For me, that's terrible. I need to display the progress of many hundreds
> or
> even thousands of hits. Even if I only call the progress bar once every 10
> hits this is still an unacceptable overhead --- and I will also get a
> jumpy
> bar.
>
> Thanks.
>
> Avraham.
>
> (Btw, greetings from Israel.)
>
>>> same with sentences
> Well, I am sure that counting sentences does not work very well on our
> machines, so if paras and words take as long then they also won't work.
> Maybe I will get around to trying them later.
>
> Thanks.
>
> Avraham.
>
> Helmut Weber wrote:
>> Hi Avi,
>>
>> 1 GHz, 768 MB Ram, 200 pages document,
>> insertion point on the last page
>>
>> MsgBox ActiveDocument.Range(0, Selection.Range.End).Words.Count
>>
>> I get the answer 27785 in a second.
>>
>> Same with paragraphs, same with sentences.
>>
>> Processing lines is something completely different,
>> they depend on e.g. pagesetup, printer, font etc.
>>
>> > ActiveDocument.Range(0, Selection.Range.End).Sentences.Count
>>
>> convoluted?
>>
>> How about this one, which is essentially the same.
>> Just a bit easier to read, maybe.
>>
>> Dim rDcm As Range
>> Set rDcm = ActiveDocument.Range
>> rDcm.End = Selection.Range.End
>> MsgBox rDcm.Words.Count
>>
>>
>> Greetings from Bavaria, Germany
>>
>> Helmut Weber, MVP, WordVBA
>>
>> Win XP, Office 2003
>> "red.sys" & Chr$(64) & "t-online.de"
>
>