![]() |
|
|
|
#1
|
||||
|
||||
|
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] |
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
macro to add brackets to each line and add single quotes to each word in the line
|
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 |
Program to read Email subject line word by word
|
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 |
Outlook 2010 Web Access Subject line length
|
Emerogork | Outlook | 4 | 06-08-2011 05:50 PM |