D
DJ Kim
Sometimes I forget to have all changes accepted before making my
revisions, when working in a collaborative environment.
What I do in such case is open up the "accept or reject changes..."
dialog box, go over the changes one by one, and accept changes made by
others and skip those made by myself, thus, making the document
showing only the changes I made.
As you can guess, this becomes a very cumbersome routine when the
document is long.
Therefore, I wrote the following code, which is supposed to accept
changes made by others.
However, it runs into an endless loop.
Could someone please tell me what's wrong?
===============================================================
Sub AcceptRevisionsByOthers()
Dim MyStoryRange As Range, MyRevision As Revision, DefaultAuthor As
String
DefaultAuthor = "myself"
For Each MyRevision In ActiveDocument.Revisions
If MyRevision.Author <> DefaultAuthor Then MyRevision.Accept
Next
For Each MyStoryRange In ActiveDocument.StoryRanges
For Each MyRevision In MyStoryRange.Revisions
If MyRevision.Author <> DefaultAuthor Then MyRevision.Accept
Next
Do While Not (MyStoryRange.NextStoryRange Is Nothing)
For Each MyRevision In MyStoryRange.Revisions
If MyRevision.Author <> DefaultAuthor Then
MyRevision.Accept
Next
Loop
Next MyStoryRange
End Sub
revisions, when working in a collaborative environment.
What I do in such case is open up the "accept or reject changes..."
dialog box, go over the changes one by one, and accept changes made by
others and skip those made by myself, thus, making the document
showing only the changes I made.
As you can guess, this becomes a very cumbersome routine when the
document is long.
Therefore, I wrote the following code, which is supposed to accept
changes made by others.
However, it runs into an endless loop.
Could someone please tell me what's wrong?
===============================================================
Sub AcceptRevisionsByOthers()
Dim MyStoryRange As Range, MyRevision As Revision, DefaultAuthor As
String
DefaultAuthor = "myself"
For Each MyRevision In ActiveDocument.Revisions
If MyRevision.Author <> DefaultAuthor Then MyRevision.Accept
Next
For Each MyStoryRange In ActiveDocument.StoryRanges
For Each MyRevision In MyStoryRange.Revisions
If MyRevision.Author <> DefaultAuthor Then MyRevision.Accept
Next
Do While Not (MyStoryRange.NextStoryRange Is Nothing)
For Each MyRevision In MyStoryRange.Revisions
If MyRevision.Author <> DefaultAuthor Then
MyRevision.Accept
Next
Loop
Next MyStoryRange
End Sub