I have inherited a broken macro to fix. Basically, the macro is supposed to find a name, replace it with another one, and insert a picture of the signature from a URL. I can get it to do one or the other, but not both. I've looked for the answer and found a lot of variations on it, but can't get it to work, and this is my first foray into Word macros and Visual Basic. I really appreciate any help I can get, because I've been ramming my head against this for a week.

I'm on a Mac, using version 16.32.

The suspected problematic chunk of code in question (placeholder names and image):

Selection.Find.Execute Replace:=wdReplaceAll

Selection.WholeStory

Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "John Smith"
.Replacement.Text = "Jane Doe"
Do While .Execute
With Dialogs(wdDialogInsertPicture)
.Name = " http://www.google.ca/intl/en_ca/images/logo.gif"
.Execute
End With
Loop
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With