Sub Link2img()
Dim TempData As DataObject, Count As Integer, ImgURL, ImgNum As String
Count = 0
Selection.HomeKey Unit:=wdStory
With Selection.Find
.ClearFormatting
.Text = "https://aaa.bbb.com/images/?*.[jpng]{3}"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
Do While (.Execute = True)
Selection.Copy
Set TempData = New DataObject
TempData.GetFromClipboard
ImgURL = TempData.GetText
Selection.Delete
Selection.InlineShapes.AddPicture FileName:=ImgURL, LinkToFile:=False, SaveWithDocument:=True
Count = Count + 1
Loop
End With
If Count < 2 Then ImgNum = " изображение"
If Count > 1 And Count < 5 Then ImgNum = " изображения"
If Count > 4 Then ImgNum = " изображений"
MsgBox ("Вставлено " & Count & ImgNum)
End Sub