A Microsoft Word forum. Microsoft Office Word Forum - WordBanter

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 » Microsoft Office Word Forum - WordBanter forum » Microsoft Word Newsgroups » Microsoft Word Help
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Printing Only Pages with Changes



 
 
Thread Tools Display Modes
  #1  
Old April 16th 08, 01:56 AM posted to microsoft.public.word.docmanagement
billbrandi
external usenet poster
 
Posts: 2
Default Printing Only Pages with Changes

After modifying a Word document and using the "track changes" option, is
there a way to print only those pages with changes (short of going through
the entire document and printing pages one by one)?

Thanks
Bill
Ads
  #2  
Old April 17th 08, 11:29 AM posted to microsoft.public.word.docmanagement
Doug Robbins - Word MVP
external usenet poster
 
Posts: 8,832
Default Printing Only Pages with Changes

If you run a macro containing the following code, it should only print the
pages on which there are revisions:

Dim revpage As Long, pageprint As Long
pageprint = 0
With ActiveDocument
For i = 1 To .Revisions.Count
.Revisions(i).Range.Select
Selection.Collapse wdCollapseStart
revpage = Selection.Information(wdActiveEndPageNumber)
If revpage pageprint Then
pageprint = revpage
.PrintOut Pages:=pageprint
End If
Next i
End With

--
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

"billbrandi" wrote in message
...
After modifying a Word document and using the "track changes" option, is
there a way to print only those pages with changes (short of going through
the entire document and printing pages one by one)?

Thanks
Bill



  #3  
Old April 18th 08, 01:16 AM posted to microsoft.public.word.docmanagement
billbrandi
external usenet poster
 
Posts: 2
Default Printing Only Pages with Changes

Thanks. When I ran the macro I got an error number 13, type mismatch. Here
is the line where the error occured:

..PrintOut Pages:=pageprint

Not being familiar with macros I was unsure how resolve.



"Doug Robbins - Word MVP" wrote:

If you run a macro containing the following code, it should only print the
pages on which there are revisions:

Dim revpage As Long, pageprint As Long
pageprint = 0
With ActiveDocument
For i = 1 To .Revisions.Count
.Revisions(i).Range.Select
Selection.Collapse wdCollapseStart
revpage = Selection.Information(wdActiveEndPageNumber)
If revpage pageprint Then
pageprint = revpage
.PrintOut Pages:=pageprint
End If
Next i
End With

--
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

"billbrandi" wrote in message
...
After modifying a Word document and using the "track changes" option, is
there a way to print only those pages with changes (short of going through
the entire document and printing pages one by one)?

Thanks
Bill




  #4  
Old April 18th 08, 07:48 AM posted to microsoft.public.word.docmanagement
Graham Mayor
external usenet poster
 
Posts: 19,312
Default Printing Only Pages with Changes

The following revised version should work:

Dim revpage As Long, pageprint As String
pageprint = 0
With ActiveDocument
For i = 1 To .Revisions.Count
.Revisions(i).Range.Select
Selection.Collapse wdCollapseStart
revpage = Selection.Information(wdActiveEndPageNumber)
If revpage pageprint Then
pageprint = revpage
Else
GoTo Skip
End If
MsgBox pageprint
.PrintOut Range:=wdPrintRangeOfPages, Copies:=1, Pages:=pageprint
Skip:
Next i
End With


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org




billbrandi wrote:
Thanks. When I ran the macro I got an error number 13, type
mismatch. Here is the line where the error occured:

.PrintOut Pages:=pageprint

Not being familiar with macros I was unsure how resolve.



"Doug Robbins - Word MVP" wrote:

If you run a macro containing the following code, it should only
print the pages on which there are revisions:

Dim revpage As Long, pageprint As Long
pageprint = 0
With ActiveDocument
For i = 1 To .Revisions.Count
.Revisions(i).Range.Select
Selection.Collapse wdCollapseStart
revpage = Selection.Information(wdActiveEndPageNumber)
If revpage pageprint Then
pageprint = revpage
.PrintOut Pages:=pageprint
End If
Next i
End With

--
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

"billbrandi" wrote in message
...
After modifying a Word document and using the "track changes"
option, is there a way to print only those pages with changes
(short of going through the entire document and printing pages one
by one)?

Thanks
Bill



  #5  
Old April 20th 08, 02:05 PM posted to microsoft.public.word.docmanagement
David Campbell
external usenet poster
 
Posts: 1
Default Printing Only Pages with Changes

I have revised the code above so that it:

- ignores formatting changes (which I typically don't want printed
out)
- warns the user if the macro is likely to take a long time to run
- collates a list of pages to be printed, rather than printing the
pages one by one (useful if either your printer prints pages in
reverse order, like mine does, or if you are on an office network
where each print job comes with a header page)
- opens the print dialog, with the changed pages to be printed, so you
can change other settings if required.

Here's the code. Any comments welcome.

Sub PrintTrackedChanges()

Dim revpagestart As Long, revpageend As Long, pageprint As String,
changedpages As String

pageprint = 0
changedpages = ""

Application.ScreenUpdating = False

currentselectionstart = Application.Selection.Start
currentselectionend = Application.Selection.End


With ActiveDocument
If .Revisions.Count = 0 Then MsgBox ("There are no revisions in this
document"): GoTo Finish
If .Revisions.Count 20 Then If MsgBox("There are" +
Str(.Revisions.Count) + " revisions in this document. Checking and
printing them may take some time. Continue?", vbYesNo) = vbNo Then
GoTo Finish

For i = 1 To .Revisions.Count
.Revisions(i).Range.Select
revpageend = Selection.Information(wdActiveEndPageNumber)
Selection.Collapse wdCollapseStart
revpagestart = Selection.Information(wdActiveEndPageNumber)

If .Revisions(i).Type = wdRevisionProperty Then GoTo Skip
If .Revisions(i).Type = wdRevisionParagraphProperty Then GoTo
Skip
If .Revisions(i).Type = wdRevisionSectionProperty Then GoTo
Skip

If pageprint = revpageend Then GoTo Skip

If revpagestart = revpageend Then
changedpages = changedpages + Str(revpageend) + ", "
pageprint = revpageend
End If

If revpageend revpagestart Then
changedpages = changedpages + Str(revpagestart) + "-" +
Str(revpageend) + ", "
pageprint = revpageend
End If
Skip:
Next i
End With

If changedpages = "" Then
MsgBox "There are no changed pages to print"
GoTo Finish
End If

changedpages = Left(changedpages, Len(changedpages) - 2)

With Dialogs(wdDialogFilePrint)
.Range = wdPrintRangeOfPages
.Pages = changedpages
.Show
End With

Finish:

Selection.SetRange Start:=currentselectionstart,
End:=currentselectionend
Application.ScreenUpdating = True

End Sub
  #6  
Old July 17th 19, 10:12 PM
Purell Purell is offline
Banned
 
First recorded activity by WordBanter: Jul 2019
Posts: 1
Default

I have used the above macro to print the pages only with changes. But the document I work on daily have cross references through put the document and when I use the document it refreshes all these cross references such as Table#'s, Figure #'s etc and print those pages as well.

Is there a way to stop the macro from doing it?
 




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 On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
DRAFT watermark printing DAT on even pages, RF on odd pages? Traceroo Page Layout 1 October 5th 05 10:07 PM
Printing one of 2 pages eddie57 New Users 2 August 30th 05 05:14 PM
Printing Odd and Even Pages??? George-NY New Users 5 March 6th 05 07:59 PM
When printing 2 pages per sheet, the pages are shortened. Headhunter Microsoft Word Help 3 February 24th 05 06:24 PM
Printing single pages or a range of pages Craig Mailmerge 1 December 13th 04 01:51 AM


All times are GMT +1. The time now is 04:45 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Copyright 2004-2019 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.