![]() |
#4
|
||||
|
||||
![]()
Nah, it's verbose!
![]() Code:
Sub Demo() Dim arrTerms(), i As Long arrTerms = Array("italics", "bold", "indent") With ActiveDocument.Range.Find .MatchWildcards = True .Replacement.Text = "\3" For i = 0 To UBound(arrTerms) .Replacement.ClearFormatting .Text = "(\<" & arrTerms(i) & ")(\>)(*)\1/\2" Select Case i Case 0: .Replacement.Font.Italic = True Case 1: .Replacement.Font.Bold = True Case 2: .Replacement.ParagraphFormat.LeftIndent = 72 End Select .Execute Replace:=wdReplaceAll Next End With End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Adding tables to Created word document whilst other word document open Help | rpb925 | Word VBA | 18 | 03-30-2016 04:45 PM |
![]() |
JennJenn79 | Word | 1 | 07-16-2015 09:34 PM |
![]() |
TDOG | Word | 1 | 10-12-2014 03:37 PM |
Copy format created by a conditional formatting | spk | Excel | 2 | 04-10-2013 04:41 AM |
Word crashing on "sort" routine | Kayale | Word | 0 | 04-12-2010 04:54 PM |