Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.formatting.longdocs
ChristyW ChristyW is offline
external usenet poster
 
Posts: 2
Default Counting the number of pages that contain highlighting

I have a kind of strange request.



We have a series of relatively long documents that have gone through several
reviews over the period of a year. Each time we have made the client's
changes from a review, we have saved a copy of the documents with the
changed paragraphs highlighted.



Now the client is asking us how many pages of these documents we have
changed in each of the reviews. Is there a way to automate a search for
this? I know we can do a "Find" for "Format: Highlight" but is there a way
to add up all the instances it finds and tally up the number of pages on
which it found a highlighted area?



Thanks.


  #2   Report Post  
Posted to microsoft.public.word.formatting.longdocs
Greg Maxey Greg Maxey is offline
external usenet poster
 
Posts: 171
Default Counting the number of pages that contain highlighting

This is problematic first of all because a Word page isn't a page until
it is displayed on a screen or printed on paper. That done, page shown
on my screen or from my printer may very well be different that that
shown on yours.

For an excellent explanation of all of this see:

http://daiya.mvps.org/wordpages.htm

That said, a crude method, and it would only account for highlighting
in the main text story range (e.g., headers, footers, footnotes, etc.
are ignored) would look something like this:

Sub ScratchMacro()
Dim oRng1 As Word.Range
Dim oRng2 As Word.Range
Dim oCount As Long
ActiveDocument.Bookmarks("\startofdoc").Select
Set oRng1 = Selection.Range
Do
Set oRng1 = ActiveDocument.Bookmarks("\Page").Range
Set oRng2 = oRng1.Duplicate
With oRng2.Find
.Highlight = True
.Execute
If .Found = True Then
oCount = oCount + 1
End If
oRng1.Collapse wdCollapseEnd
oRng1.Move wdCharacter, 1
oRng1.Select
End With
Loop Until oRng1.End = ActiveDocument.Range.End - 1
MsgBox oCount
End Sub


ChristyW wrote:
I have a kind of strange request.



We have a series of relatively long documents that have gone through several
reviews over the period of a year. Each time we have made the client's
changes from a review, we have saved a copy of the documents with the
changed paragraphs highlighted.



Now the client is asking us how many pages of these documents we have
changed in each of the reviews. Is there a way to automate a search for
this? I know we can do a "Find" for "Format: Highlight" but is there a way
to add up all the instances it finds and tally up the number of pages on
which it found a highlighted area?



Thanks.


  #3   Report Post  
Posted to microsoft.public.word.formatting.longdocs
ChristyW ChristyW is offline
external usenet poster
 
Posts: 2
Default Counting the number of pages that contain highlighting

Thanks, Greg!
That works great for what we need. As I said, it was kind of a strange
request. The number of pages doesn't really reflect the information our
client should be asking for -- some highlighted pages have several
revisions, and some have only one. But this gives us what they have asked
for without someone having to manually count the pages, so thank you!
Christy

"Greg Maxey" wrote in message
oups.com...
This is problematic first of all because a Word page isn't a page until
it is displayed on a screen or printed on paper. That done, page shown
on my screen or from my printer may very well be different that that
shown on yours.

For an excellent explanation of all of this see:

http://daiya.mvps.org/wordpages.htm

That said, a crude method, and it would only account for highlighting
in the main text story range (e.g., headers, footers, footnotes, etc.
are ignored) would look something like this:

Sub ScratchMacro()
Dim oRng1 As Word.Range
Dim oRng2 As Word.Range
Dim oCount As Long
ActiveDocument.Bookmarks("\startofdoc").Select
Set oRng1 = Selection.Range
Do
Set oRng1 = ActiveDocument.Bookmarks("\Page").Range
Set oRng2 = oRng1.Duplicate
With oRng2.Find
.Highlight = True
.Execute
If .Found = True Then
oCount = oCount + 1
End If
oRng1.Collapse wdCollapseEnd
oRng1.Move wdCharacter, 1
oRng1.Select
End With
Loop Until oRng1.End = ActiveDocument.Range.End - 1
MsgBox oCount
End Sub


ChristyW wrote:
I have a kind of strange request.



We have a series of relatively long documents that have gone through
several
reviews over the period of a year. Each time we have made the client's
changes from a review, we have saved a copy of the documents with the
changed paragraphs highlighted.



Now the client is asking us how many pages of these documents we have
changed in each of the reviews. Is there a way to automate a search for
this? I know we can do a "Find" for "Format: Highlight" but is there a
way
to add up all the instances it finds and tally up the number of pages on
which it found a highlighted area?



Thanks.




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 number pages in Word document "1 of 10", "2 of 10", etc. Kaikane Page Layout 6 July 12th 06 03:19 PM
headers: different page number placement for odd and even pages egrolman New Users 2 May 24th 06 06:39 AM
How do I number pages on doumect except first two pages tonym77 New Users 4 May 9th 06 09:25 PM
page number positioning and format tinaa Page Layout 3 February 4th 06 12:38 AM
Printing total number of pages in a section Katie Microsoft Word Help 2 December 15th 05 11:47 PM


All times are GMT +1. The time now is 01:26 AM.

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"