Inserting images in word document

C

Carlos

I would like to know if it is possible to insert an image
using VBA given its location (e.g.'c:\temp\image.jpg')
JUST the way it is done manually when opening the windows
explorer and dragging/dropping the image on the document.
I don't want a link to the location of the image.. but an
actual OLE Object(???) in my document.
 
J

Jean-Guy Marcil

Hi Carlos,

Try this
Selection.InlineShapes.AddPicture FileName:= _
"My_Path\My_Picture.jpg", _
LinkToFile:=False, SaveWithDocument:=True

or this:

ActiveDocument.Shapes.AddPicture _
FileName:="My_Path\My_Picture", _
LinkToFile:=False, SaveWithDocument:=True, _
Anchor:=Selection.Paragraphs(1).Range

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top