The problem is the search pattern. Copy the pattern from the code and search in Word. You'll see what it finds in the next steps.
I wrote the code a bit differently.
Sub JPG_xml_1()
Dim fRng As Range
Set fRng = ActiveDocument.Range
Do While fRng.Find.Execute(findText:="_*.JPG", _
MatchWholeWord:=True, MatchWildcards:=True, _
MatchCase:=False)
Set fRng = fRng.Paragraphs.Item(1).Range
fRng.Select 'tylko na czas testów!!!
With fRng
.Text = "<Picture>" & Chr(13) & "<Image href=""file://images/" & Left(.Text, Len(.Text) - 1) & """></Image>" & String(2, Chr(13))
.Collapse 0
End With
Loop
lblx_Exit:
Set fRng = Nothing
End Sub
The code seems to work, provided only the file name is in the paragraph.
Artik