Cindy, thanks. Between you and Helmut Weber I think Germany is the only place where good VBA programming is being done -- on revisions anyway.
In your reply,
Well, empty paragraphs in a document are "politically incorrect". You
should be using SpaceBefore or SpaceAfter formatting to generate space
between paragraphs. Ideally.
What do you mean by using SpaceAfter and SpaceBefore formatting.?
In writing a document, I often manually include headings at various levels to block and organize the text for making it easier to read. I don this by simply enter the heading (typing it in) and then entering a carriage return.
These one line, non sentence, "paragraphs" of text certainly do mess up Word's tracking of revisions. My recent posts in microsoft.word.vba.general describe the problem. Revision Tracking in VBA seems to repeat any revisions in a paragraph/sentence prior to one of these manual headings (it's really a "blank," one line paragraph with no sentence becasue there is no period) until it encounters a real paragraph with real sentences in it.
Your recommendation is to simply test the paragraph length and skip it if the length is zero? I think I've tried this but I'll try it again.
I think the problem will be this. Suppose the text is:
Para 6, Sentence 5: some text.
Para 7, blank line
Para 8, manual heading
Para 9, blank line
Para 10, sentence 1: some text.
Without the zero length filter, any revisions in Para 6, Sentence 5 will also appear in a range restrict to Para 7, Para 8, and Para 9. With the line length limit, I think they will still appear in Para 8, since of course it is not zero length.
I suppose I could also test for the presence of a period and skip "sentences" that are, in fact, not sentences.
My fear is that going down this track is going to lead to some very fragile and unpredicatable code. As code for extracting revisions from a document it won't be very robust. My basic question is why is revision tracking in VBA so "unpredictable," is what I woudl call it, and is there any other approach you would recommend, possibly using more sophisticated VBA concepts ? What I'm doing now is simply using three nested For i=1 to count loops to cycle through all the paragraphs, then sentence, then revisions. The code works fine at the paragraph and sentence levels but falls down on the "zero length" paragraphs.
Thanks
John wirt