View Single Post
 
Old 11-03-2014, 09:29 PM
mescaL mescaL is offline Windows 7 64bit Office 2007
Novice
 
Join Date: Nov 2014
Posts: 2
mescaL is on a distinguished road
Default Macro to insert multiple pictures to word to a specific size and text wrap

Evening,

As part of my work, I'm required to compile reports that involve inserting a lot of images from our camera into a word document and putting a caption to each photo (Fig 1, Fig 2 etc.).

The resolution from our camera makes the inserted images too big to place two photos + caption into one page, which makes editting a hassle (it actually makes up the majority of the time required to do the report)

Currently I have a macro that changes ALL current images in the word doc to a specific size, but this gets annoying because I tend to insert 5-6 images at a time and by the 10th+ image, every time I press that macro it goes through each image and takes a long amount of time. A copy of the macro is show below -

Sub PicMacro()
Dim pic As Shape

For Each pic In ActiveDocument.Shapes
With pic
.LockAspectRatio = msoTrue
If .Width > .Height Then ' horizontal
.Height = CentimetersToPoints(11)
Else ' vertical
.Height = CentimetersToPoints(12)
End If
End With
Next
End Sub


Is there anyone who can help me write a code where -
  1. Insert the images already resized to an 11cm height whilst keeping the aspect ratio
  2. If possible, insert them in the order in which they were selected
  3. Carrying on from #2, inserting them in order with a specific amount of space between each image. For example, inserting image #1 and then inserting image #2 3 lines below image #1
  4. Making the images inserted have Tight text wrapping

Any help would be deeply appreciated. If you need any clarification please let me know.

Here is an example of the reports I need to write -
Reply With Quote