Be aware that revision marks has a bug in it. The internal link list
sometimes gets hosed. It can be shown in two ways. The link is valid but it
gets you in an endless loop, or the next reference is invalid. It is very
difficult to work around and is underdocumented by Microsoft. It's caused
mostly by revisions within a table but once the link list is corrupted,
there's way of resetting it, even if the table is removed.
On the other hand, saving the document as XML solves that problem but it
gets into XML, WordML, and XSLT.
> I have a lengthy Word document that was edited with numerous changes. I left
> tracked changes on. Is there a way I can extract those changes so I can
[quoted text clipped - 3 lines]
>
> Thanks.
George, can you elaborate on the solution to this bug? I am developing code
to selectively accept revisions (e.g., made by a certain author or within a
certain date range) and I believe I'm running across the bug you mention.
(I've described the problem in detail in <
http://www.mrexcel.com/board2/viewtopic.php?t=274889&highlight= > ...)
Thanks!
Rob
> Be aware that revision marks has a bug in it. The internal link list
> sometimes gets hosed. It can be shown in two ways. The link is valid but it
[quoted text clipped - 13 lines]
> >
> > Thanks.
Shauna Kelly - 21 Jun 2007 11:36 GMT
Hi Rob
There are kind of two problems with the Revisions collection.
The first is that .Revisions.Count isn't necessarily the number of Revisions
in the document. You can see this if you use the toolbar in the UI and layer
two revisions on top of one another, perhaps with a deletion, an addition
and a formatting change. When you click the button to move to the next
Revision, Word sometimes obviously doesn't quite know where to go. It will
stop (and, say, accept) more revisions than Word reports are in the
document. Any complexity (tables, frames, footnotes etc) add to Word's
confusion.
The second problem is that any construction of the type
For Each oRev in myDoc.Revisions
'whatever
Next oRev
will lead to a mess. That's because Word doesn't really seem to know how
many revisions are in the document until it actually deals with each one.
Depending on what you're trying to do, always work with .Revisions(1) or use
a counter. If you're accepting or deleting revisions, work backwards through
the document.
If you want to accept all the revisions made by a particular author, then
use the built in tools: display only the revisions made by that author, and
then use AcceptAllRevisionsShown. See the VBA Help for
AcceptAllRevisionsShown for some sample code. (Of course when you start to
do that, you'll realize what's wrong with the Reviewers collection<g>.)
Hope this helps.
Shauna Kelly. Microsoft MVP.
http://www.shaunakelly.com/word
> George, can you elaborate on the solution to this bug? I am developing
> code
[quoted text clipped - 28 lines]
>> >
>> > Thanks.