A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Word » Formatting Long Documents
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Counting the number of pages that contain highlighting



 
 
Thread Tools Display Modes
  #1  
Old October 22nd, 2006, 09:24 PM posted to microsoft.public.word.formatting.longdocs
ChristyW
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  
Old October 23rd, 2006, 12:57 PM posted to microsoft.public.word.formatting.longdocs
Greg Maxey
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  
Old October 23rd, 2006, 04:56 PM posted to microsoft.public.word.formatting.longdocs
ChristyW
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.




 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:42 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.