Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 11-03-2014, 09:29 PM
mescaL mescaL is offline Macro to insert multiple pictures to word to a specific size and text wrap Windows 7 64bit Macro to insert multiple pictures to word to a specific size and text wrap Office 2007
Novice
Macro to insert multiple pictures to word to a specific size and text wrap
 
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
  #2  
Old 11-03-2014, 10:28 PM
gmayor's Avatar
gmayor gmayor is offline Macro to insert multiple pictures to word to a specific size and text wrap Windows 7 64bit Macro to insert multiple pictures to word to a specific size and text wrap Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

My photo gallery add-in will do this, without any need for programming - http://www.gmayor.com/photo_gallery_template.html - it was designed for such an application.

If you want to roll your own, then use a suitably sized unbordered table to hold the images. Images that are larger than a table cell will adapt to the width of that cell.
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #3  
Old 11-03-2014, 10:30 PM
mescaL mescaL is offline Macro to insert multiple pictures to word to a specific size and text wrap Windows 7 64bit Macro to insert multiple pictures to word to a specific size and text wrap Office 2007
Novice
Macro to insert multiple pictures to word to a specific size and text wrap
 
Join Date: Nov 2014
Posts: 2
mescaL is on a distinguished road
Default

Thank you very much friend, I will check it out

Have a great day
Reply With Quote
  #4  
Old 11-03-2014, 10:51 PM
macropod's Avatar
macropod macropod is offline Macro to insert multiple pictures to word to a specific size and text wrap Windows 7 64bit Macro to insert multiple pictures to word to a specific size and text wrap Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

See also: http://www.vbaexpress.com/forum/show...l=1#post306321
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to insert multiple pictures to word to a specific size and text wrap need macro insert row under specific data gogita_79 Excel Programming 2 09-15-2014 01:48 AM
Macro to insert multiple pictures to word to a specific size and text wrap Insert input box into macro to allow user to choose multiple text entries Hoxton118 Word VBA 6 04-03-2014 12:12 AM
How to automatically insert pictures the same size in word 2010 mindblaster Word 2 03-07-2013 11:42 AM
Linking: Insert > Pictures to a specific folder location hockfam PowerPoint 0 11-08-2012 08:09 PM
Macro to Insert Text Into Cells Having Multiple Lines revans611 Excel Programming 4 10-24-2011 10:15 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:38 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft