![]() |
#12
|
||||
|
||||
![]()
Try:
Code:
Sub Demo() Application.ScreenUpdating = False With ActiveDocument.Range With .Find .ClearFormatting .Replacement.ClearFormatting .Text = "<[A-Za-z]{1,7}>" .Replacement.Text = "" .Forward = True .Wrap = wdFindStop .Format = False .MatchWildcards = True .Execute End With Do While .Find.Found If .End = ActiveDocument.Range.End Then Exit Sub If .Words.Last.Next.Information(wdVerticalPositionRelativeToPage) > _ .Information(wdVerticalPositionRelativeToPage) Then .InsertBefore Chr(11) .Collapse wdCollapseEnd .Find.Execute Loop End With Application.ScreenUpdating = True End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
bracketandquotes | Word VBA | 17 | 02-16-2015 03:51 PM |
Word not 'rounding' letters up to word in next line (parents and orphans) | Asa | Word | 4 | 09-13-2014 06:47 PM |
![]() |
john23# | Outlook | 1 | 02-14-2014 10:21 PM |
Can you prevent an empty line from appearing in the first line of a page? | New Daddy | Word | 10 | 11-18-2013 07:01 AM |
![]() |
Emerogork | Outlook | 4 | 06-08-2011 05:50 PM |