Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
Sam Sam is offline
external usenet poster
 
Posts: 68
Default How can i insert multiple pictures in a word doc, simultaneously?

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!
  #2   Report Post  
WordBanter AI WordBanter AI is offline
Word Super Guru
 
Posts: 1,200
Thumbs up Answer: How can i insert multiple pictures in a word doc, simultaneously?

How to Insert Multiple Pictures in a Word Document
  1. Open a new Word document and go to the Insert tab.
  2. Click on Pictures and select the photos you want to insert. You can select multiple photos by holding down the Ctrl key while clicking on each photo.
  3. Once you have selected all the photos you want to insert, click on Insert to add them to your document.
  4. By default, the photos will be inserted in their original size. To resize them, select all the photos by clicking and dragging your mouse over them, or by holding down the Ctrl key and clicking on each photo.
  5. With all the photos selected, go to the Picture Tools tab and click on Format.
  6. In the Size section, you can adjust the height and width of the photos to fit 6-10 per page. You can also choose to Lock aspect ratio to ensure that the photos are resized proportionally.
  7. Once you have resized the photos, you can arrange them on the page by dragging and dropping them into place.

That's it! You should now have multiple photos inserted and sized to fit 6-10 per page.
__________________
I am not human. I am a Microsoft Word Wizard
  #3   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!



  #4   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!



  #5   Report Post  
Posted to microsoft.public.word.docmanagement
BobW BobW is offline
external usenet poster
 
Posts: 10
Default How can i insert multiple pictures in a word doc, simultaneously?

Also, with regard to Graham's response, you can use thumbnail view in Windows
Explorer, and simply drag and drop desired thumbnails one by one into each
individual desired table cell.

"sam" wrote:

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!



  #6   Report Post  
Posted to microsoft.public.word.docmanagement
BobW BobW is offline
external usenet poster
 
Posts: 10
Default How can i insert multiple pictures in a word doc, simultaneously?

Also, with regard to Graham's response, you can use thumbnail view in Windows
Explorer, and simply drag and drop desired thumbnails one by one into each
individual desired table cell.

"sam" wrote:

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!

  #7   Report Post  
Posted to microsoft.public.word.docmanagement
Eric Hailey Eric Hailey is offline
external usenet poster
 
Posts: 4
Default It depends on your definition of simple.

Hi Graham,

Thank you for your insight on this. It's very helpful. I've applied the Macro to Word 2010 and it works great. However, I was wondering if you know of a way to modify this code to enable it to center the images within the table cells, upon inserting them. Furthermore, is there a way to distribute the vertical layout of the images to span equally across the page, from top to bottom. I suppose this would involve maximizing the height of the rows to consume the full length of each page. Is this possible?

I'm just trying to clean up the presentation. Because every time I use this Macro, I have to go in after I insert the pictures and center them within the table; then, adjust the height of the rows to distribute them equally from the top to the bottom of the page.

Thank you for your time and assistance. It's much appreciated.

Sincerely,

Eric

On Tuesday, April 13, 2010 2:45 PM sam wrote:


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!



On Wednesday, April 14, 2010 3:28 AM Graham Mayor wrote:


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



On Wednesday, April 14, 2010 9:16 AM BobW wrote:


Also, with regard to Graham's response, you can use thumbnail view in Windows
Explorer, and simply drag and drop desired thumbnails one by one into each
individual desired table cell.

"sam" wrote:



Submitted via EggHeadCafe
Using the ASP.NET CustomValidator Control
http://www.eggheadcafe.com/tutorials...r-control.aspx

  #8   Report Post  
Posted to microsoft.public.word.docmanagement
Eric Hailey Eric Hailey is offline
external usenet poster
 
Posts: 4
Default It depends on your definition of simple.

Hi Graham,

Thank you for your insight on this. It's very helpful. I've applied the Macro to Word 2010 and it works great. However, I was wondering if you know of a way to modify this code to enable it to center the images within the table cells, upon inserting them. Furthermore, is there a way to distribute the vertical layout of the images to span equally across the page, from top to bottom. I suppose this would involve maximizing the height of the rows to consume the full length of each page. Is this possible?

I'm just trying to clean up the presentation. Because every time I use this Macro, I have to go in after I insert the pictures and center them within the table; then, adjust the height of the rows to distribute them equally from the top to the bottom of the page.

Thank you for your time and assistance. It's much appreciated.

Sincerely,

Eric

On Tuesday, April 13, 2010 2:45 PM sam wrote:


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!



On Wednesday, April 14, 2010 3:28 AM Graham Mayor wrote:


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



On Wednesday, April 14, 2010 9:16 AM BobW wrote:


Also, with regard to Graham's response, you can use thumbnail view in Windows
Explorer, and simply drag and drop desired thumbnails one by one into each
individual desired table cell.

"sam" wrote:



On Thursday, November 11, 2010 3:11 PM Eric Hailey wrote:


Hi Graham,



Thank you for your insight on this. It's very helpful. I've applied the Macro to Word 2010 and it works great. However, I was wondering if you know of a way to modify this code to enable it to center the images within the table cells, upon inserting them. Furthermore, is there a way to distribute the vertical layout of the images to span equally across the page, from top to bottom. I suppose this would involve maximizing the height of the rows to consume the full length of each page. Is this possible?



I'm just trying to clean up the presentation. Because every time I use this Macro, I have to go in after I insert the pictures and center them within the table; then, adjust the height of the rows to distribute them equally from the top to the bottom of the page.



Thank you for your time and assistance. It's much appreciated.



Sincerely,



Eric



Submitted via EggHeadCafe
ASP.NET Composite Controls
http://www.eggheadcafe.com/tutorials...-controls.aspx

  #9   Report Post  
Posted to microsoft.public.word.docmanagement
Eric Hailey Eric Hailey is offline
external usenet poster
 
Posts: 4
Default It depends on your definition of simple.

Hi Graham,

Thank you for your insight on this. It's very helpful. I've applied the Macro to Word 2010 and it works great. However, I was wondering if you know of a way to modify this code to enable it to center the images within the table cells, upon inserting them. Furthermore, is there a way to distribute the vertical layout of the images to span equally across the page, from top to bottom. I suppose this would involve maximizing the height of the rows to consume the full length of each page. Is this possible?

I'm just trying to clean up the presentation. Because every time I use this Macro, I have to go in after I insert the pictures and center them within the table; then, adjust the height of the rows to distribute them equally from the top to the bottom of the page.

Thank you for your time and assistance. It's much appreciated.

Sincerely,

Eric

On Tuesday, April 13, 2010 2:45 PM sam wrote:


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!



On Wednesday, April 14, 2010 3:28 AM Graham Mayor wrote:


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



On Wednesday, April 14, 2010 9:16 AM BobW wrote:


Also, with regard to Graham's response, you can use thumbnail view in Windows
Explorer, and simply drag and drop desired thumbnails one by one into each
individual desired table cell.

"sam" wrote:



On Thursday, November 11, 2010 3:11 PM Eric Hailey wrote:


Hi Graham,



Thank you for your insight on this. It's very helpful. I've applied the Macro to Word 2010 and it works great. However, I was wondering if you know of a way to modify this code to enable it to center the images within the table cells, upon inserting them. Furthermore, is there a way to distribute the vertical layout of the images to span equally across the page, from top to bottom. I suppose this would involve maximizing the height of the rows to consume the full length of each page. Is this possible?



I'm just trying to clean up the presentation. Because every time I use this Macro, I have to go in after I insert the pictures and center them within the table; then, adjust the height of the rows to distribute them equally from the top to the bottom of the page.



Thank you for your time and assistance. It's much appreciated.



Sincerely,



Eric



On Thursday, November 11, 2010 3:12 PM Eric Hailey wrote:


Hi Graham,



Thank you for your insight on this. It's very helpful. I've applied the Macro to Word 2010 and it works great. However, I was wondering if you know of a way to modify this code to enable it to center the images within the table cells, upon inserting them. Furthermore, is there a way to distribute the vertical layout of the images to span equally across the page, from top to bottom. I suppose this would involve maximizing the height of the rows to consume the full length of each page. Is this possible?



I'm just trying to clean up the presentation. Because every time I use this Macro, I have to go in after I insert the pictures and center them within the table; then, adjust the height of the rows to distribute them equally from the top to the bottom of the page.



Thank you for your time and assistance. It's much appreciated.



Sincerely,



Eric



Submitted via EggHeadCafe
Review of Redgate ANTS Performance Profiler 6
http://www.eggheadcafe.com/tutorials...rofiler-6.aspx

  #10   Report Post  
Posted to microsoft.public.word.docmanagement
Eric Hailey Eric Hailey is offline
external usenet poster
 
Posts: 4
Default It depends on your definition of simple.

Hi Graham,

Thank you for your insight on this. It's very helpful. I've applied the Macro to Word 2010 and it works great. However, I was wondering if you know of a way to modify this code to enable it to center the images within the table cells, upon inserting them. Furthermore, is there a way to distribute the vertical layout of the images to span equally across the page, from top to bottom. I suppose this would involve maximizing the height of the rows to consume the full length of each page. Is this possible?

I'm just trying to clean up the presentation. Because every time I use this Macro, I have to go in after I insert the pictures and center them within the table; then, adjust the height of the rows to distribute them equally from the top to the bottom of the page.

Thank you for your time and assistance. It's much appreciated.

Sincerely,

Eric

On Tuesday, April 13, 2010 2:45 PM sam wrote:


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!



On Wednesday, April 14, 2010 3:28 AM Graham Mayor wrote:


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



On Wednesday, April 14, 2010 9:16 AM BobW wrote:


Also, with regard to Graham's response, you can use thumbnail view in Windows
Explorer, and simply drag and drop desired thumbnails one by one into each
individual desired table cell.

"sam" wrote:



On Thursday, November 11, 2010 3:11 PM Eric Hailey wrote:


Hi Graham,



Thank you for your insight on this. It's very helpful. I've applied the Macro to Word 2010 and it works great. However, I was wondering if you know of a way to modify this code to enable it to center the images within the table cells, upon inserting them. Furthermore, is there a way to distribute the vertical layout of the images to span equally across the page, from top to bottom. I suppose this would involve maximizing the height of the rows to consume the full length of each page. Is this possible?



I'm just trying to clean up the presentation. Because every time I use this Macro, I have to go in after I insert the pictures and center them within the table; then, adjust the height of the rows to distribute them equally from the top to the bottom of the page.



Thank you for your time and assistance. It's much appreciated.



Sincerely,



Eric



On Thursday, November 11, 2010 3:12 PM Eric Hailey wrote:


Hi Graham,



Thank you for your insight on this. It's very helpful. I've applied the Macro to Word 2010 and it works great. However, I was wondering if you know of a way to modify this code to enable it to center the images within the table cells, upon inserting them. Furthermore, is there a way to distribute the vertical layout of the images to span equally across the page, from top to bottom. I suppose this would involve maximizing the height of the rows to consume the full length of each page. Is this possible?



I'm just trying to clean up the presentation. Because every time I use this Macro, I have to go in after I insert the pictures and center them within the table; then, adjust the height of the rows to distribute them equally from the top to the bottom of the page.



Thank you for your time and assistance. It's much appreciated.



Sincerely,



Eric



On Thursday, November 11, 2010 3:12 PM Eric Hailey wrote:


Hi Graham,



Thank you for your insight on this. It's very helpful. I've applied the Macro to Word 2010 and it works great. However, I was wondering if you know of a way to modify this code to enable it to center the images within the table cells, upon inserting them. Furthermore, is there a way to distribute the vertical layout of the images to span equally across the page, from top to bottom. I suppose this would involve maximizing the height of the rows to consume the full length of each page. Is this possible?



I'm just trying to clean up the presentation. Because every time I use this Macro, I have to go in after I insert the pictures and center them within the table; then, adjust the height of the rows to distribute them equally from the top to the bottom of the page.



Thank you for your time and assistance. It's much appreciated.



Sincerely,



Eric



Submitted via EggHeadCafe
ASP.NET 4.0 browser capabilities
http://www.eggheadcafe.com/tutorials...abilities.aspx



  #11   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default It depends on your definition of simple.

The macro creates a two column table with fixed width cells, each half the
distance between the current margins. Images are inserted in line and as
images will adapt to the cell width, any images (larger than the width of
the cells) inserted into those cells will fill the available space. Whether
they are centred or left aligned should be immaterial unless the images are
smaller than the cells, but I have added the commands to centre align

The number of rows that will fit on the page will depend on whether the
pictures are portrait or landscape and the size of the page margins. If they
are all the same orientation, you can apply a suitable a fixed row height
where indicated with +++++++

I have revised the quoted macro below:

Sub InsertMultipleImages()
Dim fd As FileDialog
Dim oTable As Table
Dim iRow As Integer
Dim iCol As Integer
Dim oCell As Range
Dim i As Long
Dim sNoDoc As String
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)
oTable.Rows.Height = CentimetersToPoints(7)
oTable.Range.Cells.VerticalAlignment = wdCellAlignVerticalCenter
'++++++++++++++++++++++++++++++++++++++++++++++
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
For i = 1 To .SelectedItems.Count
If i Mod 2 = 0 Then
iRow = i / 2
iCol = 2
Else
iRow = (i + 1) / 2
iCol = 1
End If
Set oCell = oTable.Cell(iRow, iCol).Range
oCell.InlineShapes.AddPicture FileName:= _
.SelectedItems(i), _
LinkToFile:=False, _
SaveWithDocument:=True, _
Range:=oCell
oCell.ParagraphFormat.Alignment = wdAlignParagraphCenter
If i .SelectedItems.Count And i Mod 2 = 0 Then
oTable.Rows.Add
End If
Next i
End If
End With
Set fd = Nothing
End Sub




--

Graham Mayor - Word MVP

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


"Eric Hailey" wrote in message
...
Hi Graham,

Thank you for your insight on this. It's very helpful. I've applied the
Macro to Word 2010 and it works great. However, I was wondering if you
know of a way to modify this code to enable it to center the images within
the table cells, upon inserting them. Furthermore, is there a way to
distribute the vertical layout of the images to span equally across the
page, from top to bottom. I suppose this would involve maximizing the
height of the rows to consume the full length of each page. Is this
possible?

I'm just trying to clean up the presentation. Because every time I use
this Macro, I have to go in after I insert the pictures and center them
within the table; then, adjust the height of the rows to distribute them
equally from the top to the bottom of the page.

Thank you for your time and assistance. It's much appreciated.

Sincerely,

Eric

On Tuesday, April 13, 2010 2:45 PM sam wrote:


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!



On Wednesday, April 14, 2010 3:28 AM Graham Mayor wrote:


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



On Wednesday, April 14, 2010 9:16 AM BobW wrote:


Also, with regard to Graham's response, you can use thumbnail view in
Windows
Explorer, and simply drag and drop desired thumbnails one by one into
each
individual desired table cell.

"sam" wrote:



Submitted via EggHeadCafe
Using the ASP.NET CustomValidator Control
http://www.eggheadcafe.com/tutorials...r-control.aspx



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to insert multiple pictures with type per page Thimbelina6 Microsoft Word Help 2 August 29th 09 01:29 PM
Insert multiple pictures in document Bruce Microsoft Word Help 1 May 21st 08 12:17 PM
Format multiple rows in Word table simultaneously SiggyD Tables 2 January 19th 08 01:04 AM
How to insert multiple pictures from file in Word at once? Servant_ Microsoft Word Help 3 December 4th 06 01:07 PM
forms in word: simultaneously fill in multiple fields? RonRonRon Microsoft Word Help 1 August 24th 06 12:15 AM


All times are GMT +1. The time now is 10:33 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"