Track Changes for Cross-References

P

Pam

I have cross-references to tables in my document and I have track changes
(change bars) turned on. When I update all the fields, I get change bars for
the table cross-references even though they haven't changed. Is there a way
to get Word to recognize that the field hasn't changed?
 
M

macropod

Hi Pam,

Depending on the type of cross-reference and the effect your edits have had on the referenced range (even just a change in auto para
numbering or page number), updating fields while change-tracking is on will cause the old reference to be deleted and replaced by a
new one. Turning off change tracking before doing anything that updates the cross-references will help overcome that.

As a fall-back, you can run the following macro to 'accept' all updated fields:
Sub AcceptTrackedFields()
' Macro to accept tracked changes on fields
Dim oRng As Range ' All Range objects - includes ranges in the body, Headers , Footers & Shapes
Dim Fld As Field ' Field Object
Dim oView As Variant ' The original document view
Dim SelRng As Range ' The original selection
' Turn Off Screen Updating
Application.ScreenUpdating = False
With ActiveDocument
oView = ActiveWindow.View.Type
Set SelRng = Selection.Range
' Loop through all range objects and accept tracked changes on fields
For Each oRng In .StoryRanges
Do
For Each Fld In oRng.Fields
Fld.Select
Selection.Range.Revisions.AcceptAll
Next
Set oRng = oRng.NextStoryRange
Loop Until oRng Is Nothing
Next
End With
' Restore the original document view
With ActiveWindow
If .View.SplitSpecial = wdPaneNone Then
.ActivePane.View.Type = wdPrintView
Else
.View.Type = wdPrintView
End If
.View.SeekView = wdSeekMainDocument
.View.Type = oView
SelRng.Select
End With
' Restore Screen Updating
Application.ScreenUpdating = True
End Sub
 
P

Pam

Thank you so much for the macro. I have not tested it yet. I just wanted to
clarify. All changes in the document have been accepted. When you go to
print, and it updates the fields, some of them are still showing change bars.
This happens in some documents and not in others. Is the only way to avoid
this to turn off "track changes"?

macropod said:
Hi Pam,

Depending on the type of cross-reference and the effect your edits have had on the referenced range (even just a change in auto para
numbering or page number), updating fields while change-tracking is on will cause the old reference to be deleted and replaced by a
new one. Turning off change tracking before doing anything that updates the cross-references will help overcome that.

As a fall-back, you can run the following macro to 'accept' all updated fields:
Sub AcceptTrackedFields()
' Macro to accept tracked changes on fields
Dim oRng As Range ' All Range objects - includes ranges in the body, Headers , Footers & Shapes
Dim Fld As Field ' Field Object
Dim oView As Variant ' The original document view
Dim SelRng As Range ' The original selection
' Turn Off Screen Updating
Application.ScreenUpdating = False
With ActiveDocument
oView = ActiveWindow.View.Type
Set SelRng = Selection.Range
' Loop through all range objects and accept tracked changes on fields
For Each oRng In .StoryRanges
Do
For Each Fld In oRng.Fields
Fld.Select
Selection.Range.Revisions.AcceptAll
Next
Set oRng = oRng.NextStoryRange
Loop Until oRng Is Nothing
Next
End With
' Restore the original document view
With ActiveWindow
If .View.SplitSpecial = wdPaneNone Then
.ActivePane.View.Type = wdPrintView
Else
.View.Type = wdPrintView
End If
.View.SeekView = wdSeekMainDocument
.View.Type = oView
SelRng.Select
End With
' Restore Screen Updating
Application.ScreenUpdating = True
End Sub

--
Cheers
macropod
[Microsoft MVP - Word]


Pam said:
I have cross-references to tables in my document and I have track changes
(change bars) turned on. When I update all the fields, I get change bars for
the table cross-references even though they haven't changed. Is there a way
to get Word to recognize that the field hasn't changed?

.
 
M

macropod

Hi Pam,

Yes, you really should have 'track changes' switched off before printing a document with fields.

--
Cheers
macropod
[Microsoft MVP - Word]


Pam said:
Thank you so much for the macro. I have not tested it yet. I just wanted to
clarify. All changes in the document have been accepted. When you go to
print, and it updates the fields, some of them are still showing change bars.
This happens in some documents and not in others. Is the only way to avoid
this to turn off "track changes"?

macropod said:
Hi Pam,

Depending on the type of cross-reference and the effect your edits have had on the referenced range (even just a change in auto
para
numbering or page number), updating fields while change-tracking is on will cause the old reference to be deleted and replaced by
a
new one. Turning off change tracking before doing anything that updates the cross-references will help overcome that.

As a fall-back, you can run the following macro to 'accept' all updated fields:
Sub AcceptTrackedFields()
' Macro to accept tracked changes on fields
Dim oRng As Range ' All Range objects - includes ranges in the body, Headers , Footers & Shapes
Dim Fld As Field ' Field Object
Dim oView As Variant ' The original document view
Dim SelRng As Range ' The original selection
' Turn Off Screen Updating
Application.ScreenUpdating = False
With ActiveDocument
oView = ActiveWindow.View.Type
Set SelRng = Selection.Range
' Loop through all range objects and accept tracked changes on fields
For Each oRng In .StoryRanges
Do
For Each Fld In oRng.Fields
Fld.Select
Selection.Range.Revisions.AcceptAll
Next
Set oRng = oRng.NextStoryRange
Loop Until oRng Is Nothing
Next
End With
' Restore the original document view
With ActiveWindow
If .View.SplitSpecial = wdPaneNone Then
.ActivePane.View.Type = wdPrintView
Else
.View.Type = wdPrintView
End If
.View.SeekView = wdSeekMainDocument
.View.Type = oView
SelRng.Select
End With
' Restore Screen Updating
Application.ScreenUpdating = True
End Sub

--
Cheers
macropod
[Microsoft MVP - Word]


Pam said:
I have cross-references to tables in my document and I have track changes
(change bars) turned on. When I update all the fields, I get change bars for
the table cross-references even though they haven't changed. Is there a way
to get Word to recognize that the field hasn't changed?

.
 
P

pam

OK. Thank you.

Here's an odd fix to my original problem of the cross-references to tables
showing change bars even though the fields haven't changed. I think the
problem came about from the document having been a Word 2003 document and
then being saved as a Word 2007 document. I just changed the font size and
then changed it back. The cross-references no longer shows change bars when
updating all the fields. I don't know why, but it works.

macropod said:
Hi Pam,

Yes, you really should have 'track changes' switched off before printing a document with fields.

--
Cheers
macropod
[Microsoft MVP - Word]


Pam said:
Thank you so much for the macro. I have not tested it yet. I just wanted to
clarify. All changes in the document have been accepted. When you go to
print, and it updates the fields, some of them are still showing change bars.
This happens in some documents and not in others. Is the only way to avoid
this to turn off "track changes"?

macropod said:
Hi Pam,

Depending on the type of cross-reference and the effect your edits have had on the referenced range (even just a change in auto
para
numbering or page number), updating fields while change-tracking is on will cause the old reference to be deleted and replaced by
a
new one. Turning off change tracking before doing anything that updates the cross-references will help overcome that.

As a fall-back, you can run the following macro to 'accept' all updated fields:
Sub AcceptTrackedFields()
' Macro to accept tracked changes on fields
Dim oRng As Range ' All Range objects - includes ranges in the body, Headers , Footers & Shapes
Dim Fld As Field ' Field Object
Dim oView As Variant ' The original document view
Dim SelRng As Range ' The original selection
' Turn Off Screen Updating
Application.ScreenUpdating = False
With ActiveDocument
oView = ActiveWindow.View.Type
Set SelRng = Selection.Range
' Loop through all range objects and accept tracked changes on fields
For Each oRng In .StoryRanges
Do
For Each Fld In oRng.Fields
Fld.Select
Selection.Range.Revisions.AcceptAll
Next
Set oRng = oRng.NextStoryRange
Loop Until oRng Is Nothing
Next
End With
' Restore the original document view
With ActiveWindow
If .View.SplitSpecial = wdPaneNone Then
.ActivePane.View.Type = wdPrintView
Else
.View.Type = wdPrintView
End If
.View.SeekView = wdSeekMainDocument
.View.Type = oView
SelRng.Select
End With
' Restore Screen Updating
Application.ScreenUpdating = True
End Sub

--
Cheers
macropod
[Microsoft MVP - Word]


I have cross-references to tables in my document and I have track changes
(change bars) turned on. When I update all the fields, I get change bars for
the table cross-references even though they haven't changed. Is there a way
to get Word to recognize that the field hasn't changed?

.

.
 

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