Thanks. That works fine. But the problem is I insert the caption using macro. For testing purpose. I insert it multiple times.
When I try to delete them, the lines of removed captions are still there.
I try to use the following code to check whether the previous paragraph is empty. If it is empty, then remove the line. But it returns false.
Code:
If aRng.Paragraphs(1).Previous.Range.Text = "" Then
aRng.Delete
End If