PDA

View Full Version : [SOLVED:] Find tracked changes, font color only



dirtball
06-02-2018, 05:10 PM
I frequently work with large documents that have a lot of tracked changes. I would find it incredibly useful to have a macro that can identify places where the font color has been changed and reject those changes. For this particular operation, I want to ignore all other tracked changes, including changes to other font attributes. So far, I have this:



For Each trackedchange In ActiveDocument.Revisions
If ActiveDocument.Revisions(1).Type = 3 Then
ActiveDocument.Revisions(1).Reject
End If
Next trackedchange


The problem here is that it finds any kind of change to the font, be it color, italics, bold, whatever. Is there a way to specify font color only?

macropod
06-02-2018, 08:57 PM
Track changes does not have a parameter for font colour changes - you would have to use a loop such as you now have and add to it a comparison of the before/after text to establish what has changed. The challenge will be to determine whether and what to do where changing the font colour is only part of the overall change.

dirtball
06-03-2018, 08:06 AM
Track changes does not have a parameter for font colour changes - you would have to use a loop such as you now have and add to it a comparison of the before/after text to establish what has changed. The challenge will be to determine whether and what to do where changing the font colour is only part of the overall change.

Thanks. I was kind of hoping there might be some kind of thing I could use like "If FontColorChanged = True" or whatever. Since Word is able to tell me that the color has been changed in the little info balloon off to the side, I was thinking that value might be stored somewhere in a way that would make it readily accessible to me. But you've pointed me in the right direction, and I'll play around with it for a bit and see if I can get something to work.

Failing that, I have another way to deal with it that I know will work, something I can do earlier in the workflow, but it would be a lot easier to do it the way I'm wanting to do it here.