Determine Deleted Text

J

Jim Dahlstrom

Thanks to all that respond.

Using Word 2002 in Office XP and Windows 2000

When selecting text through code with view set to "Final
Showing Markup" and without balloons I need to determine
if the selection has been deleted.

Is there a code that will set a variable with the needed
information?

Thanks,
Jim D.
 
H

Helmut Weber

Hi Jim,
do you mean something like the revision type?
The following would tell you, whether revision 3
was a deletion and show, what was deleted
With ActiveDocument.Revisions(3)
If .Type = wdRevisionDelete Then
MsgBox "Revision 3 was a deletion"
MsgBox "The deleted text = " & .Range.Text
End If
End With
See also help for
type-property for the revisions-object.
 
J

Jim Dahlstrom

Good morning Helmut. (I was going to attempt the opening
line in German, but decided not to offend you or embarass
myself by displaying my ignorance.)

Thank you for your reply.

The scenario I am dealing with is:

A customer is editing a document with change tracking on
and his type document view set to "Final Showing Markup".

His Track Changes option for "Use balloons in Print and
Web layout" is NOT checked.

Any text deletions he makes show as red text.

In the course of the editing effort, he deletes a
paragraph and later runs one of my routines that looks at
a series of paragraphs.

When it looks / selects something that is deleted, I need
to determine that is deleted in order to perform some
action.

Is there a way to determine through code if a selection
(whether the selection is a paragraph, word, or character)
within an active document has been deleted?

Thanks,
Jim
 
H

Helmut Weber

Hi Jim,
I see, I overlooked the ballon question.
Second attempt:
Sub Test333()
Dim r As Integer
With Selection.Range.Revisions
For r = 1 To .Count
If .Item(r).Type = wdRevisionDelete Then
.Item(r).Range.Select
MsgBox "This represents a deletion"
End If
Next
End With
End Sub
Should select step by step all revisions of type wdRevisionDelete
that are touched or included by the selection. If the selection
starts immediately after a deletion, this is not considered
touching a deletion.
 
J

Jim Dahlstrom

Helmut,

THANKS for your input. You have opened an area (Revision
Collection) that fits a number of applications I am
working on.

Sorry I have taken so long to respond. I have been
exploring the possibilities and use of this nugget.

Regards,
Jim D.
 

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