![]() |
|
|
|
#1
|
||||
|
||||
|
Try: Code:
Sub EditStyleSpaces()
Application.ScreenUpdating = False
Dim strStyles As String, i As Long
strStyles = "Style1,Style2,Style3,Style4"
With ActiveDocument.Content.Find
.ClearFormatting
.Format = True
.Replacement.Text = " "
.MatchWildcards = True
.Wrap = wdFindContinue
For i = 0 To UBound(Split(strStyles, ","))
.Style = Split(strStyles, ",")(i)
.Text = "[ ]{2,4}"
.Execute Replace:=wdReplaceAll
.Text = "^t"
.Execute Replace:=wdReplaceAll
Next i
End With
Application.ScreenUpdating = True
End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Delete specific text
|
Jackson | Word VBA | 16 | 12-06-2019 08:24 PM |
Macro to change specific text styles
|
ljd108 | Word VBA | 3 | 10-22-2014 03:19 PM |
Delete specific mass text on document
|
JadeRisley | Word | 4 | 07-17-2013 11:11 PM |
Using macro to delete styles
|
fogharty | Word | 1 | 10-10-2011 03:42 PM |
Need help extracting specific text from one doument to another with macro/VBA.
|
zsmithku | Word | 1 | 04-15-2011 03:46 PM |