Guest User

Untitled

a guest
Jan 4th, 2018
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Sub KhkVormistus()
  2. '
  3. ' KHK vormistus Makro
  4. '
  5. '
  6.     Selection.WholeStory ' Märgistab kogu teksti
  7.     Selection.Font.Name = "Times New Roman" ' Muudab fonti
  8.     Selection.Font.Size = 12 ' Fondi suurus
  9.     Selection.ParagraphFormat.Alignment = wdAlignParagraphJustify
  10.     With Selection.ParagraphFormat
  11.         .LeftIndent = CentimetersToPoints(0)
  12.         .RightIndent = CentimetersToPoints(0)
  13.         .SpaceBefore = 0
  14.         .SpaceBeforeAuto = False
  15.         .SpaceAfter = 6 ' Vahed peale teksti 6 punkti
  16.         .SpaceAfterAuto = False
  17.         .LineSpacingRule = wdLineSpace1pt5 ' Reavahe 1.5
  18.         .Alignment = wdAlignParagraphJustify
  19.         .WidowControl = True
  20.         .KeepWithNext = False
  21.         .KeepTogether = False
  22.         .PageBreakBefore = False
  23.         .NoLineNumber = False
  24.         .Hyphenation = True
  25.         .FirstLineIndent = CentimetersToPoints(0)
  26.         .OutlineLevel = wdOutlineLevelBodyText
  27.         .CharacterUnitLeftIndent = 0
  28.         .CharacterUnitRightIndent = 0
  29.         .CharacterUnitFirstLineIndent = 0
  30.         .LineUnitBefore = 0
  31.         .LineUnitAfter = 0
  32.         .MirrorIndents = False
  33.         .TextboxTightWrap = wdTightNone
  34.     End With
  35.     With ActiveDocument.Styles(wdStyleNormal).Font
  36.         If .NameFarEast = .NameAscii Then
  37.             .NameAscii = ""
  38.         End If
  39.         .NameFarEast = ""
  40.     End With
  41.     With ActiveDocument.PageSetup
  42.         .LineNumbering.Active = False
  43.         .Orientation = wdOrientPortrait
  44.         .TopMargin = CentimetersToPoints(3)
  45.         .BottomMargin = CentimetersToPoints(3)
  46.         .LeftMargin = CentimetersToPoints(4)
  47.         .RightMargin = CentimetersToPoints(2)
  48.         .Gutter = CentimetersToPoints(0)
  49.         .HeaderDistance = CentimetersToPoints(1.25)
  50.         .FooterDistance = CentimetersToPoints(1.25)
  51.         .PageWidth = CentimetersToPoints(21)
  52.         .PageHeight = CentimetersToPoints(29.7)
  53.         .FirstPageTray = wdPrinterDefaultBin
  54.         .OtherPagesTray = wdPrinterDefaultBin
  55.         .SectionStart = wdSectionNewPage
  56.         .OddAndEvenPagesHeaderFooter = False
  57.         .DifferentFirstPageHeaderFooter = False
  58.         .VerticalAlignment = wdAlignVerticalTop
  59.         .SuppressEndnotes = False
  60.         .MirrorMargins = False
  61.         .TwoPagesOnOne = False
  62.         .BookFoldPrinting = False
  63.         .BookFoldRevPrinting = False
  64.         .BookFoldPrintingSheets = 1
  65.         .GutterPos = wdGutterPosLeft
  66.     End With
  67.     Selection.Find.ClearFormatting
  68.     Selection.Find.Replacement.ClearFormatting
  69.     With Selection.Find ' Otsimine ja asendus
  70.         .Text = "^l"
  71.         .Replacement.Text = "^p"
  72.         .Forward = True
  73.         .Wrap = wdFindAsk
  74.         .Format = False
  75.         .MatchCase = False
  76.         .MatchWholeWord = False
  77.         .MatchWildcards = False
  78.         .MatchSoundsLike = False
  79.         .MatchAllWordForms = False
  80.     End With
  81.     Selection.Find.Execute Replace:=wdReplaceAll
  82.     Selection.Font.Bold = False ' Võtab boldi välja
  83. End Sub
Add Comment
Please, Sign In to add comment