antontizmusin_ru_dev

Untitled

May 17th, 2022 (edited)
778
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 1.08 KB | None | 0 0
  1. Sub ФиксГОСТ()
  2.  
  3.     For Each P In Selection.Paragraphs
  4.     With P
  5.         Dim LL As Long
  6.        
  7.         If .Range.ListFormat.ListType = 0 Then
  8.             LL = 0
  9.         Else
  10.             LL = P.Range.ListFormat.ListLevelNumber
  11.         End If
  12.        
  13.         If .Alignment <> wdAlignParagraphCenter Then
  14.             .Alignment = wdAlignParagraphJustify
  15.         End If
  16.  
  17.         If LL = 0 Then
  18.             If (.Alignment <> wdAlignParagraphCenter And (Not .Range.Words(1).Font.Bold)) Then
  19.                 .FirstLineIndent = CentimetersToPoints(1.25)
  20.             Else
  21.                 .FirstLineIndent = 0
  22.             End If
  23.             .LeftIndent = 0
  24.         Else
  25.             .FirstLineIndent = 0
  26.             .LeftIndent = CentimetersToPoints(1.25) * LL
  27.         End If
  28.        
  29.         .LineSpacing = LinesToPoints(1.5)
  30.         .SpaceBeforeAuto = False
  31.         .SpaceAfterAuto = False
  32.         .SpaceAfter = 0
  33.         .SpaceBefore = 0
  34.         .RightIndent = 0
  35.         .TabStops.ClearAll
  36.        
  37.         Debug.Print LL
  38.        
  39.     End With
  40.     Next P
  41. End Sub
  42.  
Add Comment
Please, Sign In to add comment