I need to add revision marks showing changes to a table of action items for a project. The first column of the table contains the action item number and the second various descriptive text. In my case, using Word's Track Changes doesn't do the trick because the table extends into the margin so the revision marks end up inside the table. I could change the margins, but there's another problem.
The rows in the table contain several short paragraphs of text. The change marks of Track Changes indicate the entire row, and not just the changed line(s), which rather defeats the purpose of the change marks.
So instead of using Track Changes, I decided to use graphic lines as revision marks to show where the changes are . Here's how the table looks when I add the revision marks manually. The line is anchored to the changed paragraph and moves with the paragraph if I enter more paragraphs of text above it.
Table Rev Marks 1.jpg
Obviously, adding these marks manually is quite a nuisance, especially if there are many of them.
I have created the following macro as a workaround. With only trial and error VBA experience, this might not be the best code, but it does work.
This works ok, except that the revision mark gets anchored to the number in the first column rather than to the changed paragraph, even though the editing cursor (insertion point) is in the changed paragraph when I invoke the macro. Here's what the result looks like.Sub RevLine() Dim lineNew As Shape 'Get vertical position of cursor (insertion point) Location = Selection.Information(wdVerticalPositionRelativeToPage) 'Add a line to the drawing Set lineNew = ActiveDocument.Shapes.AddLine( _ BeginX:=40, BeginY:=Location, EndX:=40, EndY:=Location + 15) 'Lock the anchor lineNew.LockAnchor = True 'Set line weight and color With lineNew.Line .Weight = 1.5 .ForeColor.RGB = RGB(Red:=0, Green:=0, Blue:=0) End With End Sub
Table Rev Marks 2.jpg
With this result, if I insert an additional paragraph before the changed one, the revision mark doesn't move with it. In addition, the vertical alignment of the number in the first column has changed to top aligned.
Is there anything I can do in the macro to force the revision line to anchor to the changed paragraph?
Thanks.