Hi! Try this:
Code:
Sub Find_Str_Add_Shape()
'In the selection, find the inputboxed string & add a transparent
'blue oval shape over it.
Dim rng As range
Dim stri As String
Dim shp As shape
Set rng = selection.range
stri = InputBox("Enter the string to find:")
rng.Find.text = stri
rng.Find.Execute
If rng.Find.found Then
rng.Select
Set shp = ActiveDocument.Shapes.AddShape(msoShapeOval, _
selection.Information(wdHorizontalPositionRelativeToPage), _
selection.Information(wdVerticalPositionRelativeToPage), _
20, 16)
With shp
.Fill.Transparency = 1 'Full transparency
.Line.ForeColor.RGB = RGB(0, 0, 255) 'Blue color
.Line.Visible = msoTrue
End With
End If
End Sub
You may change 'Set rng = selection.range' to 'Set rng = ActiveDocument.range'.