![]() |
#12
|
||||
|
||||
![]()
Try:
Code:
Sub Demo() Application.ScreenUpdating = False ActiveWindow.View.ShowFieldCodes = True With ActiveDocument.Range With .Find .ClearFormatting .Replacement.ClearFormatting .Text = "^d CITATION" .Replacement.Text = "" .Forward = True .Wrap = wdFindStop .Format = False .MatchCase = False .MatchWholeWord = False .MatchWildcards = False .MatchSoundsLike = False .MatchAllWordForms = False .Execute End With Do While .Find.Found .Start = .Start - 1 .MoveStartWhile " ", -1 .Start = .Start - 1 If .Characters.First Like "[?!:;.]" Then .End = .End + 1 .InsertAfter .Characters.First With .Duplicate .Collapse wdCollapseStart .MoveEndWhile " ", 1 .Delete End With End If .Collapse wdCollapseEnd .Find.Execute Loop End With ActiveWindow.View.ShowFieldCodes = False Application.ScreenUpdating = True End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
dan_1 | Word | 12 | 01-24-2017 12:43 PM |
![]() |
truepharaoh | Word | 3 | 12-03-2016 01:35 AM |
![]() |
chakyt22 | Word | 1 | 09-29-2015 03:37 AM |
![]() |
richards_jacqui@sky.com | Outlook | 1 | 04-01-2015 10:40 PM |
![]() |
Wes | Word | 1 | 05-29-2012 10:29 AM |