I have Word for Mac 2011 on a MacBook with Yosemite 10.10.5. In Word I am trying to create a macro that will insert a file named home.gif into Word documents. home.gif is in a directory called “List” which is a sub-directory of “Kindle” which is on my desktop (Desktop\Kindle\List).
The recorded steps are: Insert>>Photo>>Picture from file ...>>Desktop>> Kindle>>List>>home.gif>>Insert
Here is the result:
Selection.InlineShapes.AddPicture filename:= _
“/Users/macbookpro/Desktop/Kindle/List/home.gif”, LinkToFile=False._
SaveWithDocument=True
Selection.InlineShapes.AddPicture filename:=”, LinkToFile:=False, _
SaveWithDocument:=True
On another forum, I read that the hyphens should be colons, so I changed it to this:
Selection.InlineShapes.AddPicture filename:= _
“Users.macbookpro.Desktop.Kindle.List.home.gif”, LinkToFile=False._
SaveWithDocument=True
Selection.InlineShapes.AddPicture filename:=”, LinkToFile:=False, _
saveWithDocument:=True
That brought up: ““Can’t execute code in Break Mode”.
:< That's a colon..< That's a period. Also, you can just useApplication.PathSeparator- SierraOscar-. The Linux style file-path that the macro record spit out should work fine (although it is case sensitive). What exactly is your question though? Are you getting an error? - Comintern