Revisions programming: where to find info?

J

John Wirt

Revision marking is hard to program in Word VBA. Everything seems to be
different than programming regular text in paragraphs. My current hypothesis
is that the best way to extract revisions is using the "NextRevision"command
rather than the Revisions collection.

Where could I find information about the revision commands in VBA and how to
use them?

The basic problem I have is finding all the revision marking (insertions or
deletions) and printing them out by paragraph and (hopefully) sentence
number.

Some of the revisions are in tables....(whoa is me)

I will buy a book or resouce kit but, of course, info on the web is always
useful.

John Wirt
 
D

Doug Robbins - Word MVP - DELETE UPPERCASE CHARACT

Hi John,

The best source of info is probably the vba help file. I doubt that you
will find too much about this in any book.

Something like this might do what you want:

Dim myrange As Range, arev As Revision, i As Long, source As Document,
target As Document
Set source = ActiveDocument
Set target = Documents.Add
For i = 1 To source.Paragraphs.Count
Set myrange = source.Paragraphs(1).Range
For Each arev In myrange.Revisions
target.Range.InsertAfter arev.Type & " " & arev.Range.Text & vbTab &
i & vbCr
Next arev
Next i

The following is a list of the revision types from the VBE help file and the
corresponding numeral that will be returned by the above

WdRevisionType can be one of these WdRevisionType constants.


0 wdNoRevision
1 wdRevisionDelete
2 wdRevisionInsert
3 wdRevisionParagraphProperty
4 wdRevisionReconcile
5 wdRevisionSectionProperty
6 wdRevisionStyleDefinition
7 wdRevisionConflict
8 wdRevisionDisplayField
9 wdRevisionParagraphNumber
10 wdRevisionProperty
11 wdRevisionReplace
12 wdRevisionStyle
13 wdRevisionTableProperty


--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.
Hope this helps
Doug Robbins - Word MVP
 

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