• detect text that has been deleted (Word 2003)

    Home » Forums » AskWoody support » Productivity software by function » Visual Basic for Applications » detect text that has been deleted (Word 2003)

    Author
    Topic
    #455183

    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,

    Viewing 0 reply threads
    Author
    Replies
    • #1131940

      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.

    Viewing 0 reply threads
    Reply To: detect text that has been deleted (Word 2003)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: