Frage

I am writing a VBA procedure in Word 2010 that searches a document for a search term. If it is found, I want to run some other code, but only if no portion of the resultant text is revised. So I can't just loop through the document revisions, because I need to find text that is not revised. I would like to either exclude revised text from the search (but I couldn't find an option under Selection.Find that did that), or check if the selected text is revised after the search executes (but I couldn't find an option under Selection.Range.Revisions that did that either).

War es hilfreich?

Lösung

It seems, based on quick try and test I've just made, that the answer is quite simple. You need to find appropriate text range and check .Revisions property as follows (here, for Selection):

If Selection.Range.Revisions.Count > 0 Then
     'selected range is inside revision
Else 
     'selected range is not revised
End if
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top