Converting track changes marking to new document content

C

Charles Belov

I have a need to convert tracked changes (additions and deletions) to text
with actual double underlines (for additions) and strikethroughs (for
deletions). That is, if highlighting of tracked changes is turned off, I see
additions as having a double underline and deletions as having a single
strikethrough.

The issue is that the macro which converts Word to Adobe PDF will not tag
the document for accessibility if changes are highlighted, but the change
markings need to show in the resulting PDF.

Is there a quick way to do this in Word 2003 for Windows?

Charles Belov
SFMTA Webmaster
www.sfmta.com/webmaster
 
D

Doug Robbins - Word MVP

Run a macro containing the following code on a copy of the document when
Track Changes is turned off (otherwise the formatting changes that it makes
will be shown as revisions)

Dim arev As Revision
With ActiveDocument
For Each arev In .Revisions
If arev.Type = wdRevisionDelete Then
arev.Range.Font.StrikeThrough = True
arev.Reject
ElseIf arev.Type = wdRevisionInsert Then
arev.Range.Font.Underline = wdUnderlineDouble
arev.Accept
End If
Next arev
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, originally posted via msnews.microsoft.com
 
C

Charles Belov

Thanks! I added the following line before the loop to turn Tracked Changes
off automatically when the macro is run:

ActiveDocument.TrackRevisions = False

The macro works great in the body text. However, it is missing the revisions
in the header and footer. I tried repeating the loop as follows:

With ActiveDocument
....
End With
With ActiveDocument.StoryRanges(wdPrimaryHeaderStory)
....
End With
With ActiveDocument.StoryRanges(wdPrimaryFooterStory)
....
End With

where ... is replaced by the For/Next loop below, but the macro still only
catches the changes in the body.

If I manually accept each change in the document, it accepts the header and
footer changes so it is not the case that Word itself is overlooking the
revisions. It appears to be an issue of the scope of the macro.

Still, even if I have to do the headers and footers manually, it is a big
improvement over having to do the whole document manually, so thank you very
much.
 
D

Doug Robbins - Word MVP

The following should also pick up changes to the headers and footers:

Dim arev As Revision
Dim i As Long, j As Long
With ActiveDocument
For Each arev In .Revisions
If arev.Type = wdRevisionDelete Then
arev.Range.Font.StrikeThrough = True
arev.Reject
ElseIf arev.Type = wdRevisionInsert Then
arev.Range.Font.Underline = wdUnderlineDouble
arev.Accept
End If
Next arev
For i = 1 To .Sections.Count
For j = 1 To .Sections(i).Headers.Count
With .Sections(i).Headers(j).Range
For Each arev In .Revisions
If arev.Type = wdRevisionDelete Then
arev.Range.Font.StrikeThrough = True
arev.Reject
ElseIf arev.Type = wdRevisionInsert Then
arev.Range.Font.Underline = wdUnderlineDouble
arev.Accept
End If
Next arev
End With
Next j
For j = 1 To .Sections(i).Footers.Count
With .Sections(i).Headers(j).Range
For Each arev In .Revisions
If arev.Type = wdRevisionDelete Then
arev.Range.Font.StrikeThrough = True
arev.Reject
ElseIf arev.Type = wdRevisionInsert Then
arev.Range.Font.Underline = wdUnderlineDouble
arev.Accept
End If
Next arev
End With
Next j
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, originally posted via msnews.microsoft.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top