Word Count - But not all of them!

N

Nightowl4933

Hi,
Is it possible to use the word count feature in Office 2007 (and hopefully
in Word 2003) to count the words in specific pages in a document?

I don't want to include the title page or appendices.

Thank you,

Pete
 
H

Helmut Weber

Hi Pete,

e.g.

Sub Macro9()
With Selection
.Collapse
.ExtendMode = False
.GoTo what:=wdGoToPage, _
which:=wdGoToAbsolute, _
Count:=4
With .Bookmarks("\page").Range
MsgBox .ComputeStatistics(wdStatisticWords)
MsgBox .Words.Count
End With
End With
End Sub

However, what constitutes a word is a fuzzy concept
of fuzzy natural language.


--

Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Vista Small Business, Office XP
 
N

Nightowl4933

Hi Helmut,

Thanks for your help, but perhaps I should have been a bit more clear :-(

I was hoping to use a field in the document to have a running total similar
to the the word count box in the status bar with a result similar to that
when text is selected, if you understand my meaning.

Thanks,

Pete
 
H

Helmut Weber

Hi Pete,

there is no Word Count Box in the status bar.
There is a toolbar "Word Count" wich maybe placed
above the status bar, or wherever.

It shows what commands like this one return:
MsgBox ActiveDocument.BuiltInDocumentProperties("Number of Words")

You may insert a field like:
{ DOCPROPERTY Words \* MERGEFORMAT }

and update the field regularly using an ontime macro,
or using an event, like the windowselectionchange event.

Demanding for a beginner, though.

Don't know where "page" comes in here.

--

Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Vista Small Business, Office XP
 

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