Can I use a macro to insert pictures from a folder into Word?

Basically, I have folders containing pictures that we downloaded from our camera.  We want to be able to insert all of the pictures in the folder to a word document.  We would also like to have the file name (path not necessary) pasted directly beneath it.

Is this possible?

It would be nice to have a message window pop up asking the user to paste the address of the folder.

The folders will only contain pictures.
It would be an added bonus to be able to scale the images... maybe by including the option in the same window as the address input box?
Who is Participating?
GrahamSkanConnect With a Mentor RetiredCommented:
You could try this
Sub InsertPictures()
Dim strFolder As String
Dim strFile As String
Dim ilsh As InlineShape

strFolder = "C:\Users\Public\Pictures\Sample Pictures"
strFile = Dir$(strFolder & "\*.*")
Do Until strFile = ""
    Set ilsh = ActiveDocument.InlineShapes.AddPicture(strFolder & "\" & strFile, False, True, ActiveDocument.Bookmarks("\EndofDoc").Range)
    ActiveDocument.Bookmarks("\EndofDoc").Range.Text = vbCr & strFile & vbCr
    strFile = Dir$()

End Sub

Open in new window

Sub Macro3()
' Macro3 Macro
' Macro recorded 7/20/2006 by Delana Harper

With ActiveDocument.Bookmarks(1)

LinkToFile:= _
False, SaveWithDocument:=True

End With

End Sub
I had this macro working you can try it and see if it gives desired results
The new generation of project management tools

With’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

mdemint1Author Commented:

Thanks, but this macro only inserts a single image.  What I am wanting is a macro that inserts every image in a folder.  The user should also be able to specify the address to the folder containing said pictures.
Check out the following link. I am not sure how much help you can get from here but yeah may be:

mdemint1Author Commented:
All I had to change was:

strFolder = InputBox("Enter Folder Location", "Folder Location", "X:\")

Thanks so much!!
All Courses

From novice to tech pro — start learning today.