Results 1 to 4 of 4
  1. #1
    Lounger
    Join Date
    Apr 2005
    Location
    Silver Spring, Maryland, USA
    Posts
    36
    Thanks
    0
    Thanked 1 Time in 1 Post

    detect text that has been deleted (Word 2003)

    I'm writing a macro that finds all instances of some text, then deletes the entire row containing it. I'd like to detect whether the selection or the range that is found has already been deleted.

    Currently I just turn off display of tracked changes temporarily to avoid the problems that come with the macro finding the already-deleted instance in an infinite loop. But if there's a way to detect deletion, please let me know for future use.

    Thanks,

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: detect text that has been deleted (Word 2003)

    You could inspect the following properties of the range where it's found (use Selection.Range if you're working with Selection.Find):

    .Revisions.Count should be 1, i.e. the range should contain just one revision, not a mixture.
    .Revisions(1).Type should be wdRevisionDelete.

  3. #3
    Lounger
    Join Date
    Apr 2005
    Location
    Silver Spring, Maryland, USA
    Posts
    36
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: detect text that has been deleted (Word 2003)

    Thanks. I searched but didn't find the Revisions property.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: detect text that has been deleted (Word 2003)

    Revisions is a property of the Document and Range objects: see Revisions Property, Revisions Collection Object and Revision Object.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •