Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / February 2008

Tip: Looking for answers? Try searching our database.

Word Count - But not all of them!

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Nightowl4933 - 17 Feb 2008 11:50 GMT
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
Helmut Weber - 17 Feb 2008 12:08 GMT
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
Nightowl4933 - 17 Feb 2008 12:54 GMT
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

> Hi Pete,
>
[quoted text clipped - 24 lines]
>
> Vista Small Business, Office XP
Helmut Weber - 18 Feb 2008 15:50 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.