View Single Post
 
Old 10-08-2015, 07:44 AM
cyraxote cyraxote is offline Windows 7 64bit Office 2013
Novice
 
Join Date: Sep 2015
Location: Essex, MD
Posts: 24
cyraxote is on a distinguished road
Default

Thanks!

That's so much simpler than what I was trying to do. I wish I had a better grasp of the range object.

So here's what I have:
Code:
Sub Demo()
Application.ScreenUpdating = False
Dim i As Long
With ActiveDocument
  For i = 2 To .Paragraphs.Count
    With .Paragraphs(i)
      If (.Range.Style = "TEXT") And (.Previous.Range.Style = "TEXT") Then
        .Range.Style = "TEXT IND"
      End If
      If (.Range.Style = "TEXT") And (.Previous.Range.Style = "TEXT IND") Then
        .Range.Style = "TEXT IND"
      End If
    End With
  Next
End With
Selection.WholeStory
    With Selection.ParagraphFormat
        .SpaceBefore = 0
        .SpaceBeforeAuto = False
        .SpaceAfter = 6
        .SpaceAfterAuto = False
        .LineSpacingRule = wdLineSpaceSingle
    End With
Application.ScreenUpdating = True
End Sub
I can add to this to perform a bunch of checks I've been thinking of. I think Select Case may work better than If... Then for that.

Just one question: why start with the 2nd paragraph?

Thanks again.
Reply With Quote