View Single Post
 
Old Today, 01:19 PM
macropod's Avatar
macropod macropod is offline Windows 10 Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,511
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

C'mon, that's a trivial change:
Code:
Sub FormatAndDelete()
'Format left titles
Application.ScreenUpdating = False
Dim oPar As Paragraph
For Each oPar In ActiveDocument.Paragraphs
  With oPar.Range
    If .ComputeStatistics(wdStatisticLines) = 1 Then
      If .ParagraphFormat.Alignment = wdAlignParagraphLeft Then
        If Not .Text Like "*[0-9]*" Then
          If .Characters.Last.Previous = "." Then .Characters.Last.Previous = vbNullString
          .Style = "LeftTitle"
        End If
      End If
    End If
  End With
Next oPar
Application.ScreenUpdating = True
End Sub
PS: when posting code, please post it between the code tags, i.e.
HTML Code:
[CODE]Your code goes here[/CODE]
not between pairs of code tags as you've been doing.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote