Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / August 2005

Tip: Looking for answers? Try searching our database.

Revisions, track changes:

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
TRM - 12 Aug 2005 21:55 GMT
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.


Cindy M  -WordMVP- - 13 Aug 2005 11:05 GMT
Hi =?Utf-8?B?VFJN?=,

I think I read somewhere that this may be causing a memory leak. Might be
worthwhile to open a support incident with Microsoft.

Other than that, I can only suggest that you save on a regular basis (every 10,
50 or n loops) to try to avoid stuff "accumulating" that may be preventing the
successful save.

> 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.
[quoted text clipped - 10 lines]
> "hung up" in the loop - or an error message "disk is full" occurs on the
> document when it is closed/saved.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :-)
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.