![]() |
#6
|
||||
|
||||
![]()
You could achieve the desired effect with 'Track Changes' using a macro such as:
Code:
Sub Demo() Application.ScreenUpdating = False Dim i As Long With ActiveDocument.Range With .Find .ClearFormatting .Replacement.ClearFormatting .Text = "" .Replacement.Text = "" .Font.Italic = True .Forward = True .Wrap = wdFindStop .Format = True End With Do While .Find.Execute i = i + 1 .InsertBefore "(" With .Duplicate .Collapse wdCollapseEnd .Text = ")" .Font.Italic = False End With If .Information(wdWithInTable) = True Then If .End = .Cells(1).Range.End - 1 Then .End = .Cells(1).Range.End .Collapse wdCollapseEnd If .Information(wdAtEndOfRowMarker) = True Then .End = .End + 1 End If End If End If .Collapse wdCollapseEnd If (ActiveDocument.Range.End - .End) < 2 Then Exit Do Loop End With Application.ScreenUpdating = True MsgBox i & " instances found." End Sub For Mac macro installation & usage instructions, see: Word:mac - Install a Macro
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
Tags |
find and replace, find what text |
Thread Tools | |
Display Modes | |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
d4okeefe | Word VBA | 18 | 06-30-2022 11:35 PM |
![]() |
paik1002 | Word VBA | 5 | 03-10-2016 10:50 PM |
![]() |
jc491 | Word VBA | 14 | 01-06-2016 08:57 PM |
![]() |
norgro | Word VBA | 1 | 01-23-2015 10:58 PM |
Find and replace inside strings containing various names | audioman | Word VBA | 4 | 03-25-2014 11:19 AM |