#1   Report Post  
Posted to microsoft.public.word.docmanagement
Nelda
 
Posts: n/a
Default word counting

I need to have a word count on each page in my document (over 500 pages).
We can only have so many words and lines on each page. I know how to set up
the line count but not the word count. Thank you
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Jezebel
 
Posts: n/a
Default word counting

Step 1: write a macro that selects each page in turn, calculates the word
count, and saves the value as a document variable with a name like Vnnn,
where nnn is the page number.

Step 2: add a docvariable field to the header or footer where you want to
display the value --

{ DocVariable { Page \# "V000" } }






"Nelda" wrote in message
...
I need to have a word count on each page in my document (over 500 pages).
We can only have so many words and lines on each page. I know how to set
up
the line count but not the word count. Thank you



  #3   Report Post  
Posted to microsoft.public.word.docmanagement
Nelda
 
Posts: n/a
Default word counting

Thank you but I have no idea how to do macros. I forgot to tell you that
I'm just starting.

"Jezebel" wrote:

Step 1: write a macro that selects each page in turn, calculates the word
count, and saves the value as a document variable with a name like Vnnn,
where nnn is the page number.

Step 2: add a docvariable field to the header or footer where you want to
display the value --

{ DocVariable { Page \# "V000" } }






"Nelda" wrote in message
...
I need to have a word count on each page in my document (over 500 pages).
We can only have so many words and lines on each page. I know how to set
up
the line count but not the word count. Thank you




  #4   Report Post  
Posted to microsoft.public.word.docmanagement
Doug Robbins - Word MVP
 
Posts: n/a
Default word counting

The following macro will create the document variables

Sub InsertNumberofWordsonPage()
Dim i As Long
Dim Source As Document
Dim varname As String
Set Source = ActiveDocument
Selection.HomeKey Unit:=wdStory

Pages = Source.BuiltInDocumentProperties(wdPropertyPages)
i = 0
While i Pages
i = i + 1
varname = "V" & Format(i, "000")
With Source
.Variables(varname).Value =
..Bookmarks("\page").Range.ComputeStatistics(wdSta tisticWords)
.Bookmarks("\Page").Range.Cut
End With
Wend
Source.Undo (i)
End Sub

To create the docvariable field { DocVariable { Page \# "V000" } }that
Jezebel gave you, you must use Ctrl+F9 for each pair of field delimiters.

Make sure you save the document BEFORE running the above macro just in case
something goes wrong as it deletes each page of the document and then undoes
the deletion. In testing here though, everything worked fine.
--
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

"Nelda" wrote in message
...
Thank you but I have no idea how to do macros. I forgot to tell you that
I'm just starting.

"Jezebel" wrote:

Step 1: write a macro that selects each page in turn, calculates the word
count, and saves the value as a document variable with a name like Vnnn,
where nnn is the page number.

Step 2: add a docvariable field to the header or footer where you want to
display the value --

{ DocVariable { Page \# "V000" } }






"Nelda" wrote in message
...
I need to have a word count on each page in my document (over 500
pages).
We can only have so many words and lines on each page. I know how to
set
up
the line count but not the word count. Thank you






  #5   Report Post  
Posted to microsoft.public.word.docmanagement
Nelda
 
Posts: n/a
Default word counting

Thank you for you for trying to help me, but I can't get it to work. It keep
stopping on ..Bookmarks("\page").Range.ComputeStatistics(wdSta tisticWords).
I don't know what I have done or haven't done. this stuff really makes a
person feel stupid.

"Doug Robbins - Word MVP" wrote:

The following macro will create the document variables

Sub InsertNumberofWordsonPage()
Dim i As Long
Dim Source As Document
Dim varname As String
Set Source = ActiveDocument
Selection.HomeKey Unit:=wdStory

Pages = Source.BuiltInDocumentProperties(wdPropertyPages)
i = 0
While i Pages
i = i + 1
varname = "V" & Format(i, "000")
With Source
.Variables(varname).Value =
..Bookmarks("\page").Range.ComputeStatistics(wdSta tisticWords)
.Bookmarks("\Page").Range.Cut
End With
Wend
Source.Undo (i)
End Sub

To create the docvariable field { DocVariable { Page \# "V000" } }that
Jezebel gave you, you must use Ctrl+F9 for each pair of field delimiters.

Make sure you save the document BEFORE running the above macro just in case
something goes wrong as it deletes each page of the document and then undoes
the deletion. In testing here though, everything worked fine.
--
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

"Nelda" wrote in message
...
Thank you but I have no idea how to do macros. I forgot to tell you that
I'm just starting.

"Jezebel" wrote:

Step 1: write a macro that selects each page in turn, calculates the word
count, and saves the value as a document variable with a name like Vnnn,
where nnn is the page number.

Step 2: add a docvariable field to the header or footer where you want to
display the value --

{ DocVariable { Page \# "V000" } }






"Nelda" wrote in message
...
I need to have a word count on each page in my document (over 500
pages).
We can only have so many words and lines on each page. I know how to
set
up
the line count but not the word count. Thank you








  #6   Report Post  
Posted to microsoft.public.word.docmanagement
Jay Freedman
 
Posts: n/a
Default word counting

The newsgroup introduced an unwanted line break, and I think Doug got an
extra dot in that line by mistake. These two lines should be combined into
one line, with only one dot before "Bookmarks":

.Variables(varname).Value =
..Bookmarks("\page").Range.ComputeStatistics(wdSta tisticWords)

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

Nelda wrote:
Thank you for you for trying to help me, but I can't get it to work.
It keep stopping on
..Bookmarks("\page").Range.ComputeStatistics(wdSta tisticWords). I
don't know what I have done or haven't done. this stuff really makes
a person feel stupid.

"Doug Robbins - Word MVP" wrote:

The following macro will create the document variables

Sub InsertNumberofWordsonPage()
Dim i As Long
Dim Source As Document
Dim varname As String
Set Source = ActiveDocument
Selection.HomeKey Unit:=wdStory

Pages = Source.BuiltInDocumentProperties(wdPropertyPages)
i = 0
While i Pages
i = i + 1
varname = "V" & Format(i, "000")
With Source
.Variables(varname).Value =
..Bookmarks("\page").Range.ComputeStatistics(wdSta tisticWords)
.Bookmarks("\Page").Range.Cut
End With
Wend
Source.Undo (i)
End Sub

To create the docvariable field { DocVariable { Page \# "V000" }
}that Jezebel gave you, you must use Ctrl+F9 for each pair of field
delimiters.

Make sure you save the document BEFORE running the above macro just
in case something goes wrong as it deletes each page of the document
and then undoes the deletion. In testing here though, everything
worked fine. --
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

"Nelda" wrote in message
...
Thank you but I have no idea how to do macros. I forgot to tell
you that I'm just starting.

"Jezebel" wrote:

Step 1: write a macro that selects each page in turn, calculates
the word count, and saves the value as a document variable with a
name like Vnnn, where nnn is the page number.

Step 2: add a docvariable field to the header or footer where you
want to display the value --

{ DocVariable { Page \# "V000" } }






"Nelda" wrote in message
...
I need to have a word count on each page in my document (over 500
pages).
We can only have so many words and lines on each page. I know
how to set
up
the line count but not the word count. Thank you



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 do I "reveal codes" in Word the way I could in Word Perfect? crystal Microsoft Word Help 3 May 11th 06 02:10 AM
WP merge file to Word sstires Tables 4 February 14th 06 06:26 PM
How can Word display full path of a file in the title bar? SAsif Microsoft Word Help 1 January 26th 06 04:32 PM
Does Word have a QuickCorrect/Quick Word option like WordPerfect? CW New Users 2 December 20th 05 05:54 PM
Envelope Address GR New Users 5 April 24th 05 09:48 PM


All times are GMT +1. The time now is 02:41 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"