PDA

View Full Version : Find issue with tracked changes



heedaf
03-03-2020, 02:47 PM
Well this issue got me again. Finally I remembered that the issue is with having the searched word being changed with revision history. I'm doing a simple find on a rng:

Selection.range.find.execute FindText:=StrToFind. The value I'm searching on in the range has revision history which prevents it from finding what I want. Is there a way to make the vba .find ignore the revision history and only search on what is shown in the simple markup view?

macropod
03-04-2020, 07:36 PM
Depending on what you're trying to achieve, you might employ a custom UndoRecord, accepting or rejecting the revisions before doing your Find, then restoring the previous condition afterwards. Alternatively, you might rework your StrToFind expression so that it becomes a wildcard term that can accommodate revisions. You could even include the deleted revision text in your Find expression. You really haven't given us enough to work with.