Consider the following table in Word 2013
A BBB
A CCC
D E F
A, B and C are merged cells.
A and B are empty. C has text A
inside.
Now the following code
Set rng = ActiveDocument.Range(0, 0)
With rng.Find
.Forward = True
.Wrap = wdFindStop
.Execute "A"
End With
Crashes word on Execute "A"
.
If I change text to Execute "B"
it doesn't find anything but doesn't crash word. Issue is present only in word 2013.
We tried searching manually and Selection.Find
cell by cell, but both of those are rather slow.
Is there a quick way to circumvent this error?
EDIT: this is minimum fail example that I constructed. In our application we use a lot of Range.Find
, sometimes with wrap and almost never starting from Document.Start
EDIT2: further investigation shows that Error isn't present if you open Document in compatibility mode (Word 97-2003 format).
selection.find
feature. What is a goal of the bounty you proposed? – Kazimierz Jawor