Automatically insert pictures/photos in Word

Carlandrewlewis used Ask the Experts™
I have a a template that i insert photos from site into and wondered if there is a way to do this automatically by adding some sort of link?? any advice would be apreciated!! Regards
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

You could try this in word 2007.

Insert a linked picture from a Web page
Open the Word document.
On the Web page, right-click the picture you want, and then click Copy.
In the Word document, right-click where you want to insert the picture, and then click Paste.


I was looking more down the line of having a folder with a list of photos in e.g. photo1, photo2, photo3 etc and then inserting a link to the file path and haveing Word automatically find the representing picture and inserting it into the document?? Any ideas?
Pieter JordaanSenior Systems Administrator - Web hosting and Network Security.


You will have to look at Visual basic to automate it.

I have seen some wonderful document automation scripts on Linux using open office, but I haven't tried the windows version of it.
Top Expert 2012
This is a Word VBA macro:
Sub InsertPictures()
Dim strFolder As String
Dim strFile As String
Dim ilsh As InlineShape

strFolder = "C:\MyFolder"
strFile = Dir$(strFolder & "\*.jpg")
Do Until strFile = ""
    Set ilsh = ActiveDocument.InlineShapes.AddPicture(strFolder & "\" & strFile, False, True, ActiveDocument.Bookmarks("\EndOfDoc").Range)
    strFle = Dir$()
End Sub

Open in new window


Thanks works a treat!!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial