![]() |
#2
|
||||
|
||||
![]()
The following would leave one empty paragraph between paragraphs, but it would be far better to remove all empty paragraphs and apply styles to give the spacing you require. See also Replace using wildcards
Code:
Sub Macro1() With Selection.Find .ClearFormatting .Replacement.ClearFormatting .Text = "^13{2,}" .Replacement.Text = "^p^p" .Forward = True .Wrap = wdFindContinue .Format = False .MatchCase = False .MatchWholeWord = False .MatchAllWordForms = False .MatchSoundsLike = False .MatchWildcards = True .Execute Replace:=wdReplaceAll End With End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
gavi12 | Word VBA | 1 | 04-04-2020 05:42 AM |
![]() |
vibor | Word VBA | 9 | 05-03-2015 05:42 AM |
![]() |
dexter30 | Word VBA | 2 | 08-05-2013 08:37 PM |
regular expressions for empty lines | eNGiNe | Word | 1 | 01-21-2013 06:38 AM |
Deleting empty lines | lostsoul62 | Word | 5 | 04-16-2012 04:55 AM |