Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-24-2015, 09:59 AM
jsoule jsoule is offline Insert paragraph break before images Windows 7 64bit Insert paragraph break before images Office 2013
Novice
Insert paragraph break before images
 
Join Date: Feb 2015
Posts: 2
jsoule is on a distinguished road
Question Insert paragraph break before images


I am trying to add a macro that will find an image and insert a paragraph break before that image. My documents contain at least 100 images each, so doing this manually is too time consuming. I'm not familiar with writing macros - I just know how to use them... Help?
Reply With Quote
  #2  
Old 02-24-2015, 04:32 PM
Guessed's Avatar
Guessed Guessed is offline Insert paragraph break before images Windows 7 32bit Insert paragraph break before images Office 2010 32bit
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,969
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

Assuming the graphics are placed inline, the following macro would do it
Code:
Sub AddParasBeforeImages()
  Dim aPict As InlineShape
  For Each aPict In ActiveDocument.InlineShapes
    aPict.Range.Paragraphs(1).Range.InsertBefore vbCr
  Next aPict
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #3  
Old 02-25-2015, 02:42 AM
gmayor's Avatar
gmayor gmayor is offline Insert paragraph break before images Windows 7 64bit Insert paragraph break before images 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

I wasted my time answering this in another forum - https://social.msdn.microsoft.com/Fo...s?forum=isvvba.

If you must post in a variety of forums, please cross post correctly.
__________________
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
  #4  
Old 02-25-2015, 07:53 AM
jsoule jsoule is offline Insert paragraph break before images Windows 7 64bit Insert paragraph break before images Office 2013
Novice
Insert paragraph break before images
 
Join Date: Feb 2015
Posts: 2
jsoule is on a distinguished road
Default

Well, thank you, gmayor, as your find/replace with a wild card worked. I will also be keeping the macro that Guessed suggested on file for future use. I really appreciate both of you taking the time to answer my question, as I spent my entire work day yesterday manually putting in paragraph breaks...

I apologize for the multiple forum posts.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert paragraph break before images keep several lines & images together without a page-break interfering lyle Word 1 02-11-2014 03:57 AM
Images disturbing paragraph shading behind younggun Word 0 10-12-2013 04:35 AM
Records paragraph break ervilhaman Mail Merge 14 04-09-2013 02:55 PM
i want to insert page break without repeat row on top gsrikanth Excel 0 05-24-2012 04:07 AM
URGENT: Mail 'Merge To New Doc' restarts paragraph numbering at each Section break JamesF Mail Merge 0 07-28-2011 07:26 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:04 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