Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 02-15-2015, 06:34 AM
gmayor's Avatar
gmayor gmayor is offline Inserting Carriage Return Windows 7 64bit Inserting Carriage Return Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,142
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 ofgmayor has much to be proud of
Default

Manual formatting, like that you propose, simply perpetuates the problem. Create (or modify) a paragraph style to provide you with the spacing you want and apply it to the paragraphs.

The following will kill the two birds with one stone, by creating a suitable style in the document (if the name doesn't exist) to apply 36 points of space before each item.

Code:
Sub Macro1()
Dim oStyle As Style
Dim bStyle As Boolean
Dim oPara As Paragraph
    For Each oStyle In ActiveDocument.Styles
        If oStyle.NameLocal = "Extra Space" Then
            bStyle = True
            Exit For
        End If
    Next oStyle
    If Not bStyle Then
        ActiveDocument.Styles.Add name:="Extra Space", _
                                  Type:=wdStyleTypeParagraph
        With ActiveDocument.Styles("Extra Space")
            .AutomaticallyUpdate = False
            .ParagraphFormat.SpaceBefore = 36
            .NoSpaceBetweenParagraphsOfSameStyle = False
        End With
    End If
    For Each oPara In ActiveDocument.Paragraphs
        If oPara.Range.Text Like "Choice (*" Then
            oPara.Style = "Extra Space"
        End If
    Next oPara
lbl_Exit:
    Exit Sub
End Sub
__________________
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
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Plain Text Content Control - Losing Styling on Carriage Return kintap Word 0 07-16-2014 12:43 PM
Inserting Carriage Return stop carriage return or enter key in a table Alaska1 Word 1 01-14-2013 08:48 AM
Inserting Carriage Return Coding into a macro a carriage return sinbad Word VBA 6 02-27-2012 03:51 AM
Inserting Carriage Return Paragraph (carriage) return font size revrossreddick Word 2 12-28-2011 01:33 PM
Carriage Return Help UCHelp Word 1 04-04-2010 10:11 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:32 AM.


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