T
TRM
Here is a snippet of code I have which is supposed to go through a document
(with track changes turned on) and check for any deletions, then accept them.
Dim oRvs As Object
For Each oRvs In oDoc.Revisions 'oApp.ActiveDocument.Revisions
If oRvs.type = wdRevisionDelete Then
oRvs.Accept
End If
Next
Now, it does seem to do this, however, occasionally a document will get
"hung up" in the loop - or an error message "disk is full" occurs on the
document when it is closed/saved.
I am trying to make sure I am understanding this code... I am learning and
got this code snippet from someone kind enough to post a suggestion for me.
I thought I understood what it's doing: basically checking any revisions in
the document to see if it's a deletion, then approving if it is. In trying
to trouble shoot this latest error, I'm finding I'm not entirely correct!
I created a document with approximately 15 or so "changes" (being an initial
document, they would all be tracked of course). The code looped through 19
times. I then approved the changes, and made some new ones, probably about
4, one being a deletion. The code still looped through about 18 times
(that's what I counted, it could have been 19). Now, if my thought process
was correct, it's looping through only the actual REVISIONS, then it would
have gone through the second time about 4 times - not the 18. So, does this
check just the revisions, or are there other "divisions" of the document -
such as header, footer, first page and body; or sections - or ????
Thanks for the time, clarification, and expertise!! Also, if you have a
reason why this would get "caught up" - I would appreciate thoughts about
that too!
THANKS again.
(with track changes turned on) and check for any deletions, then accept them.
Dim oRvs As Object
For Each oRvs In oDoc.Revisions 'oApp.ActiveDocument.Revisions
If oRvs.type = wdRevisionDelete Then
oRvs.Accept
End If
Next
Now, it does seem to do this, however, occasionally a document will get
"hung up" in the loop - or an error message "disk is full" occurs on the
document when it is closed/saved.
I am trying to make sure I am understanding this code... I am learning and
got this code snippet from someone kind enough to post a suggestion for me.
I thought I understood what it's doing: basically checking any revisions in
the document to see if it's a deletion, then approving if it is. In trying
to trouble shoot this latest error, I'm finding I'm not entirely correct!
I created a document with approximately 15 or so "changes" (being an initial
document, they would all be tracked of course). The code looped through 19
times. I then approved the changes, and made some new ones, probably about
4, one being a deletion. The code still looped through about 18 times
(that's what I counted, it could have been 19). Now, if my thought process
was correct, it's looping through only the actual REVISIONS, then it would
have gone through the second time about 4 times - not the 18. So, does this
check just the revisions, or are there other "divisions" of the document -
such as header, footer, first page and body; or sections - or ????
Thanks for the time, clarification, and expertise!! Also, if you have a
reason why this would get "caught up" - I would appreciate thoughts about
that too!
THANKS again.