Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
Scott Scott is offline
external usenet poster
 
Posts: 92
Default word count in word 2007

im trying to automatically add a word count to the bottom of each page in a
document created in word 2007 can anyone help me please
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Suzanne S. Barnhill Suzanne S. Barnhill is offline
external usenet poster
 
Posts: 33,624
Default word count in word 2007

You can do it using a NumWords field in the footer, but note that it won't
be a word count for the page but for the whole document. You can select text
(the whole page, for example) and get a word count for the selection, but
there's no field for that, nor any switch to tell NumWords to count just a
selection.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
http://word.mvps.org

"scott" wrote in message
...
im trying to automatically add a word count to the bottom of each page in
a
document created in word 2007 can anyone help me please


  #3   Report Post  
Posted to microsoft.public.word.docmanagement
Greg Maxey[_2_] Greg Maxey[_2_] is offline
external usenet poster
 
Posts: 668
Default word count in word 2007

Scott,

No small challenge and you may not be satisfied with the result. Part of
the problem is if the page is already "full" of words then adding more
(i.e., the word count) would push existing words to the next page. That
part can be overcome.

The problem that will likely lead to unsatisfactory results is the type of
things that Word considers a words.

Try running the following macro. This computes the number of words in a
built-in bookmark "\Page" range for each page and displays the results in a
textbox outside the traditional margins.

Sub ComputeWordsPerPage()
Dim oRng As Word.Range
Dim oShape As Shape
Dim oCount As Long
Set oRng = ActiveDocument.Content
oRng.Collapse wdCollapseStart
oRng.Select
Do
Set oRng = Selection.Bookmarks("\Page").Range
oCount = oRng.ComputeStatistics(wdStatisticWords)
oRng.Collapse wdCollapseEnd
oRng.Move wdCharacter, -1
Set oShape =
ActiveDocument.Shapes.AddTextbox(msoTextOrientatio nHorizontal, 0, 0, 125,
20)
With oShape
.TextFrame.TextRange.Text = oCount & " words this page."
.Left = InchesToPoints(0)
.RelativeHorizontalPosition = wdRelativeHorizontalPositionPage
.Top = InchesToPoints(9)
.RelativeVerticalPosition = wdRelativeVerticalPositionPage
End With
oRng.Move wdCharacter, 1
oRng.Select
Loop Until oRng.End = ActiveDocument.Range.End - 1
End Sub


scott wrote:
im trying to automatically add a word count to the bottom of each
page in a document created in word 2007 can anyone help me please


--
Greg Maxey - Word MVP

My web site http://gregmaxey.mvps.org
Word MVP web site http://word.mvps.org



  #4   Report Post  
Posted to microsoft.public.word.docmanagement
Greg Maxey[_2_] Greg Maxey[_2_] is offline
external usenet poster
 
Posts: 668
Default word count in word 2007

Scott,

I have added a bit of refinement to the macro so if the word count changes
it is easier to update the displayed count:

Sub ComputeWordsPerPage()
Dim oRng As Word.Range
Dim i As Long
Dim oShape As Shape
Dim oCount As Long
Set oRng = ActiveDocument.Content
oRng.Collapse wdCollapseStart
oRng.Select
i = 1
Do
On Error Resume Next
Set oShape = ActiveDocument.Shapes("Page " & i & " word count")
oShape.Delete
On Error GoTo 0
Set oRng = Selection.Bookmarks("\Page").Range
oCount = oRng.ComputeStatistics(wdStatisticWords)
oRng.Collapse wdCollapseEnd
oRng.Move wdCharacter, -1
Set oShape =
ActiveDocument.Shapes.AddTextbox(msoTextOrientatio nHorizontal, 0, 0, 160,
24)
With oShape
.Name = "Page " & i & " word count"
.TextFrame.TextRange.Text = "This page contains " & oCount & " words."
.Fill.ForeColor = wdColorLightYellow
.Left = InchesToPoints(0)
.RelativeHorizontalPosition = wdRelativeHorizontalPositionPage
.Top = InchesToPoints(9.25)
.RelativeVerticalPosition = wdRelativeVerticalPositionPage
End With
oRng.Move wdCharacter, 1
oRng.Select
i = i + 1
Loop Until oRng.End = ActiveDocument.Range.End - 1
End Sub

--
Greg Maxey - Word MVP

My web site http://gregmaxey.mvps.org
Word MVP web site http://word.mvps.org


"scott" wrote in message
...
im trying to automatically add a word count to the bottom of each page in
a
document created in word 2007 can anyone help me please



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to count words in sections using Word 2007, when EndNote used? Dianne Griffin Microsoft Word Help 1 November 26th 08 11:26 PM
Count of words in Word 2007 and count in 2003 are different Gabi Microsoft Word Help 2 May 27th 08 12:20 PM
Character count in Word 2007 status bar? Tommy Microsoft Word Help 3 January 20th 08 04:16 PM
How do I find character count in Word 2007? TamLyn New Users 1 September 2nd 07 09:09 PM
how do you count words/characters on word 2007 outlook calendar Microsoft Word Help 2 August 8th 07 07:37 PM


All times are GMT +1. The time now is 10:06 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"