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 » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Macro to print only pages which got revised in word document



 
 
Thread Tools Display Modes
  #1  
Old July 17th 19, 09:53 PM
Purell Purell is offline
Banned
 
First recorded activity by WordBanter: Jul 2019
Posts: 1
Default Macro to print only pages which got revised in word document

Hello,

This is something I need help from you guys. I have a pretty large document and when these documents gets revised instead of searching where the changes happened and print them. Is there a way to print only the pages where changes happened.

I have found a Macro to do this, print only the pages where changes happened but when I hit print the document gets refreshed and all the cross referenced such as Table numbers, figure numbers get updated and when I used the macro it prints those pages as well.

Below is the Marco I have got from some user in this forum:

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
Ads
  #2  
Old August 5th 19, 10:37 AM
jessicahenry jessicahenry is offline
Junior Member
 
First recorded activity by WordBanter: Aug 2019
Posts: 1
Default

Hello, thank you for sharing. I am also interested in the same problem as you run 3
 




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
Revised pages need different footers -- how? Dave Page Layout 2 December 4th 09 02:04 AM
Word Viewer - viewing revised document without revision balloons? DFerrier Microsoft Word Help 0 April 17th 07 09:14 PM
number revised pages Joyce Microsoft Word Help 1 November 2nd 06 12:29 PM
Macro help - how to print a watermark on all pages! [email protected] Microsoft Word Help 5 July 25th 06 09:51 AM
Using a macro, is there a way to print a document in WORD and have turner Microsoft Word Help 0 November 9th 05 08:11 PM


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


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.