PDA

View Full Version : Tracking Changes after acceptance: Text has to be bold



olgushka1122
08-18-2010, 03:02 PM
Hi All,
After I accept all tracking changes, I want the changed text to be bold or different color? Any idea?

fumei
08-18-2010, 11:38 PM
It is easy enough, at least to do what you ask...although NOT literally.

Sub BoldAcceptedChanges()
Dim oRev As Revision
Dim r As Range

For Each oRev In ActiveDocument.Revisions
Set r = oRev.Range
oRev.Accept
r.Font.Bold = True
Next
End Sub
Each revision is made a range object and then accepted, and then the range object bolded. Note the order of action.

You asked about bolding AFTER you accept. This is not possible unless:

1. you create a range object for each revision
AND
2 action that range object before going on to the next revision.

Once you accept the revisions, they become just text, like any other text in the document. In other words, once accepted you can not identify them as being previously revisions.

Theoretically, you COULD build an array of previous revisions and identify them after the fact, but I certainly would not recommend going down that road.

BTW: re changing font colour (or any other attribute) is exactly the same procedure.

Sub BoldAcceptedChanges()
Dim oRev As Revision
Dim r As Range

For Each oRev In ActiveDocument.Revisions
Set r = oRev.Range
oRev.Accept
r.Font.Color = wdColorBrightGreen
Next
End Sub

fumei
08-19-2010, 12:03 AM
Sub GiveChoiceToBold()
Dim j As Long
For j = 0 To UBound(RevRanges())
RevRanges(j).Select
If MsgBox("Bold this text - previously revised??", vbYesNo) = vbYes Then
RevRanges(j).Font.Bold = True
End If
Next
End Sub
To bold an array of previous ranges - RevRanges() - that were revisions. Note I am only using Select so you can see the text previously a revision.