Insert a JPG into word

  • Thread starter Steven Craig Basham
  • Start date
S

Steven Craig Basham

Quick question! How do I programmatically insert a JPG image into my word
document? Do use the inlineshapes.new method ?


an example of code would be greatly appreciated!
 
J

Jay Freedman

Steven said:
Quick question! How do I programmatically insert a JPG image into
my word document? Do use the inlineshapes.new method ?


an example of code would be greatly appreciated!

Not .New, but .AddPicture...

Dim oPic As InlineShape
Set oPic = ActiveDocument.InlineShapes _
.AddPicture(FileName:="C:\graphics\c7side.jpg", _
linktofile:=False, _
savewithdocument:=True)
oPic.Width = InchesToPoints(2)

Look up the AddPicture keyword in the VBA help to see what you can do with
it.
 

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