Go to a word at a particular number?

B

Bert Coules

Apologies if this a is well-worn question, but I've searched around and
can't find the answer. I'm using Word 2000 under Windows XP Pro.

Is it possible to navigate through a document by word-count? In other
words, could I start at the top of a lengthy file and go to, for example,
the five hundred and fiftieth word? And then, starting at that point, go to
the point in the document which is two hundred words further on? And so on?

Many thanks in advance.

Bert
www.bertcoules.co.uk
 
B

Bert Coules

Anne said:
Without using VBA (and I think some tough-to-write VBA at that), the only
method I'm aware of is Ctrl+Right arrow.

Anne, thanks for the reply. It seems incredible: I can GoTo a specified
page, line, section, field, equation and all the rest of it, but not a
particularly-numbered word. For a programme with such amazing capabilities,
Word certainly has some astonishing limitations.

Perhaps it would be possible to write a macro that executes "go to next
word" a specific number of times (asking for a user-input for the exact
number)? But I have no experience with macros, alas, and wouldn't know
where to start.

Bert
www.bertcoules.co.uk
 
S

Suzanne S. Barnhill

I'm not a coder, but I actually don't think the VBA would be too difficult.
If you don't get an answer here, post in one of the word.vba NGs.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
B

Bert Coules

Suzanne said:
I'm not a coder, but I actually don't think the VBA would be too
difficult.
If you don't get an answer here, post in one of the word.vba NGs.

Suzanne, thanks for that advice. Out of interest, do you share my surprise
that this feature isn't available in Word?

Bert
www.bertcoules.co.uk
 
D

Doug Robbins - Word MVP

Such a macro is not that complex. The following will ask you for the number
of the word that you want to go to and then take you to it:

Dim wordnum As Long
wordnum = InputBox("Enter the number of the word to which you want to go",
"Go to Word Number", 1)
ActiveDocument.Words(wordnum).Select


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
S

Suzanne S. Barnhill

No. Obviously, I don't share your need for it, and I really can't envision
an application for such a feature.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
B

Bert Coules

Doug said:
Such a macro is not that complex. The following will ask you for the
number of the word that you want to go to and then take you to it:

Doug, thanks very much for that. In my ignorance, I'm amazed at how small
and seemingly simple the code is.

I hope you won't think me ungrateful if I say that it appears to count
punctuation marks and carriage returns as words, which slightly diminishes
its usefulness for my particular job. Is there a reasonably simple way of
getting round that?

Bert
www.bertcoules.co.uk
 
B

Bert Coules

Suzanne said:
I really can't envision an application for such a feature.

I have a lengthy (80,000+ word) document which I have to divide up into
4000-word sections. And I anticipate having more of the same in the future.

Perhaps it's not as common a need as I thought. (Or perhaps there is
another way of doing it, which *does* already exist in Word but which I
haven't thought of?)

Cheers,

Bert
www.bertcoules.co.uk
 
S

Suzanne S. Barnhill

Surely you're not going to chop a MS arbitrarily after the 4,000th word? If
you feel you must divide it, use another measurement, such as pages or
(better) chapters or other logical divisions.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
D

Doug Robbins - Word MVP

I will wait until you respond to Suzanne's last question. I likewise cannot
imagine that splitting a document on every nth word is really the most
appropriate thing to do.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
B

Bert Coules

Suzanne said:
Surely you're not going to chop a MS arbitrarily after the 4,000th word?

No, of course I'm not. But I have to divide it into sections of
approximately that number, and how else am I going to find the
starting-points from which to look for a nearby neat division if I can't
first find out where the 4000-word point comes?

Bert
www.bertcoules.co.uk
 
B

Bert Coules

Doug Robbins wrote:

I hope I've explained the circumstances in my answer to Suzanne Barnhill:
the exact 4000-word markers are starting points from which to find the
nearest neat and convenient places to divide the text. The exact size of
the subsequent sections has to be approximately 4000 words but doesn't have
to be exactly that number.

Unless I can first identify where the 4000-word points occur, I can't really
begin; and unfortunately including punctuation and returns in the count
would throw things off rather too much.

Does that make things clearer? I appreciate your help.

Bert
www.bertcoules.co.uk
 
D

Doug Robbins - Word MVP

Given that situation, I guess all you can do is add some allowance for
punctuation on top of the 4000.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
B

Bert Coules

Doug said:
Given that situation, I guess all you can do is add some allowance for
punctuation on top of the 4000.

I'll do my best! Thanks.

I had wondered about a macro which would execute Ctrl+right-arrow a set
number of times according to user-input, but of course Ctrl+right-arrow
recognises punctuation as words too, doesn't it. A strange situation, that,
or so it seems to my simple brain...

Thanks again for your help.

Bert
www.bertcoules.co.uk
 
B

Bert Coules

Doug said:
...I guess all you can do is add some allowance for punctuation on top of
the 4000.

Doug, I've been playing around with the whole word count utility. I hadn't
previously realised that it counts any item which is preceded and succeeded
by spaces as a word: so, for example, "one - two - three" is reported as
five words, which it patently is not.

Short of a macro which first counts everything which Word regards as words
then tallies up all the included non-words and subtracts them from the
count, do you know of any way to obtain a genuine word-count?

Bert
www.bertcoules.co.uk
 
D

Doug Robbins - Word MVP

Bert,

The following will come closer to selecting the actual number of words that
are entered into the input box.

Dim wordnum As Long
Dim i As Long
Dim wordrange As Range
Dim source As Document
Dim realwords As Long
Set source = ActiveDocument
wordnum = InputBox("Enter the number of the word to which you want to go", _
"Go to Word Number", 1)
Set wordrange = source.Range
wordrange.End = source.Words(wordnum).End
wordrange.Select
Set Temp = Dialogs(wdDialogToolsWordCount)
Temp.Execute
realwords = Temp.Words
Set Temp = Nothing
i = 1
Application.ScreenUpdating = False
Do While realwords < wordnum
Set wordrange = source.Range
wordrange.End = source.Words(wordnum + i).End
wordrange.Select
Set Temp = Dialogs(wdDialogToolsWordCount)
Temp.Execute
realwords = Temp.Words
i = i + 1
Set Temp = Nothing
Loop
Application.ScreenRefresh
Application.ScreenUpdating = True

Depending upon the number of "bogus" words it may take a little while to
run.

Note however that one - two - three will still count as 5 words. On the
other hand one-two-three will count as 1 word.


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top