![]() |
|
#3
|
||||
|
||||
|
IIRC, the ' + Left: 0.89' doesn't denote part of the Style name, but a format that has been used to override it. Accordingly, you would have to Find paragraphs in the style named Style Body, then test their format to see whether they have the + Left: 0.89 formatting applied. The macro recorder won't do that. Try the following code:
Code:
Sub Demo()
Application.ScreenUpdating = False
Dim Sty As Style, sOffset As Single
sOffset = CentimetersToPoints(0.89)
With ActiveDocument
Set Sty = .Styles("Body Text")
With .Range
With .Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = "^p"
.Style = Sty.NameLocal
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
.Execute
End With
Do While .Find.Found
With .Paragraphs(1)
If CentimetersToPoints(Round(PointsToCentimeters(.LeftIndent), 2)) = _
Sty.ParagraphFormat.LeftIndent + sOffset Then .Style = "List 3"
End With
.Collapse wdCollapseEnd
.Find.Execute
Loop
End With
End With
Application.ScreenUpdating = True
End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
How to globally change the formatting of a bullet style to another style?
|
ravl13 | Word | 5 | 03-10-2013 05:04 PM |
"Table of content" based on "Normal Style" behavior!!!!
|
Jamal NUMAN | Word | 4 | 07-08-2011 04:12 AM |
How the "Style" and the "List" are linked??
|
Jamal NUMAN | Word | 1 | 06-30-2011 05:18 PM |
| "Change Word Options" don't change | ADKREV | Word | 0 | 11-12-2010 10:56 AM |
| How do I change the "and" to "or" with multiple Rules (and Alerts)? | bschimmel | Outlook | 0 | 11-16-2009 05:26 AM |