# Microsoft Office Application Help - Excel Help forum > For Other Platforms(Mac, Google Docs, Mobile OS etc) >  >  Insert Image in Mac Word 2011 Using Macro

## jmsn1

I recorded the following macro and keep getting the same error. I've looked at every link on from a Google search and nothing has worked. I am trying to insert the same image each time a *** is found in a Word file. I am using Mac Word 2011. I get a runtime error 5152, but the image is not a URL. It is in a folder on my desktop. I found another query that had a similar issue and the person was advised to delete the last two lines. I tried the same, and it didn't work. The macro is below. I replaced my username (which as no spaces) with the XXXXX shown below. Otherwise, this is how it appears, and it won't run. 


Sub InsertImage()
'
' InsertImage Macro
'
'
    Selection.Find.ClearFormatting
    Selection.Find.Style = ActiveDocument.Styles("***")
    With Selection.Find
        .Text = "***"
        .Replacement.Text = ""
        .Forward = True
        .Wrap = wdFindContinue
        .Format = True
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
    End With
    Selection.Find.Execute
    Selection.InlineShapes.AddPicture fileName:= _
        "/Users/XXXXX/Desktop/Elaine/flowerflourish.jpg", LinkToFile:= _
        False, SaveWithDocument:=True
    Selection.InlineShapes.AddPicture fileName:="", LinkToFile:=False, _
        SaveWithDocument:=True
End Sub

----------

