View Single Post
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default How can i insert multiple pictures in a word doc, simultaneously?

It depends on your definition of simple. In order to control the layout of
the images you need to insert them in a table of fixed cell width. The
images will then adapt to the width of the cell. How many will fit of a page
is determined by whether the images are portrait mode or landscape mode - or
mixed modes.

The following macro will insert a two column table at the cursor and proceed
to enter all the images that you select from the dialog into the cells of
that table. You can experiment with the number of columns in the table, but
somewhere between 1 and 3 will do the job.
http://www.gmayor.com/installing_macro.htm

Sub InsertMultipleImages()
Dim fd As FileDialog
Dim oTable As Table
Dim sNoDoc As String
Dim vrtSelectedItem As Variant
If Documents.Count = 0 Then
sNoDoc = MsgBox(" " & _
"No document open!" & vbCr & vbCr & _
"Do you wish to create a new document to hold the images?", _
vbYesNo, "Insert Images")
If sNoDoc = vbYes Then
Documents.Add
Else
Exit Sub
End If
End If
'add a 1 row 2 column table to take the images
Set oTable = Selection.Tables.Add(Selection.Range, 1, 2)
oTable.AutoFitBehavior (wdAutoFitFixed)
Set fd = Application.FileDialog(msoFileDialogFilePicker)
With fd
.Title = "Select image files and click OK"
.Filters.Add "Images", "*.gif; *.jpg; *.jpeg; *.bmp; *.tif; *.png"
.FilterIndex = 2
If .Show = -1 Then
oTable.Cell(1, 1).Select
For Each vrtSelectedItem In .SelectedItems
With Selection
.InlineShapes.AddPicture FileName:= _
vrtSelectedItem _
, LinkToFile:=False, SaveWithDocument:=True, _
Range:=Selection.Range
.MoveRight Unit:=wdCell
End With
Next vrtSelectedItem
Else
End If
End With
If Len(oTable.Rows.Last.Cells(1).Range) = 2 Then
oTable.Rows.Last.Delete
End If
Set fd = Nothing
End Sub


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



"sam" wrote in message
...
Hello!

I need to put in multiple photos from a file in my reports, and i would
like
them to be sized to fit 6-10 per page. Is there any way to do that in one
simple step?

Thanks!