Filehost.ro - gazduire fisiere
Mrrrr's Forum (VIEW ONLY)
Un forum care ofera solutii pentru unele probleme legate in general de PC. Pe langa solutii, aici puteti gasi si alte lucruri interesante // A forum that offers solutions to some PC related issues. Besides these, here you can find more interesting stuff.
Nou pe simpatie:
Profil sexy_andrea2006
Femeie
24 ani
Sibiu
cauta Barbat
27 - 53 ani
Mrrrr's Forum (VIEW ONLY)ReguliInregistrareLoginPozeNu sunteti logat. Lista Forumurilor Pe Tematici
Mrrrr's Forum (VIEW ONLY) / Tutoriale si Ghiduri Utile // Tutorials and useful guides /

[WORD] Toggle Insert Page Break / Toggle Reset Paragraph

Pagini: 1 Moderat de TRaP, TonyTzu
#1
TRaP
Moderator
Postari: 960
Two codes for two functions. Though unconnected, I added them in the same topic. These can both be recorded with macro recording button.

Insert Page Break from current pointer location:


Sub InsertPageBreak()
    Selection.InsertBreak Type:=wdPageBreak
End Sub


Reset paragraph (space between lines to zero, no indent etc.)


Sub ResetParagraph()

    With Selection.ParagraphFormat
        .RightIndent = CentimetersToPoints(0)
        .SpaceBefore = 0
        .SpaceBeforeAuto = False
        .SpaceAfter = 0
        .SpaceAfterAuto = False
        .LineSpacingRule = wdLineSpaceSingle
        .WidowControl = True
        .KeepWithNext = False
        .KeepTogether = False
        .PageBreakBefore = False
        .NoLineNumber = False
        .Hyphenation = True
        .FirstLineIndent = CentimetersToPoints(0)
        .OutlineLevel = wdOutlineLevelBodyText
        .CharacterUnitRightIndent = 0
        .CharacterUnitFirstLineIndent = 0
        .LineUnitBefore = 0
        .LineUnitAfter = 0
        .MirrorIndents = False
        .TextboxTightWrap = wdTightNone
        .CollapsedByDefault = False
    End With
End Sub


 
   
#2
TRaP
Moderator
Postari: 960
Button to remove spaces before and after paragraph if they exist in 3 pt increments:


Sub ParagraphRemove3ptBeforeAndAfter()
Dim unit As Single
    unit = 3
On Error Resume Next
    If (Selection.ParagraphFormat.SpaceBefore > 0) Then _
        Selection.ParagraphFormat.SpaceBefore = (Selection.ParagraphFormat.SpaceAfter - unit)
       
        If (Selection.ParagraphFormat.SpaceAfter > 0) Then _
            Selection.ParagraphFormat.SpaceAfter = (Selection.ParagraphFormat.SpaceAfter - unit)

End Sub


 
   
Pagini: 1  
Mergi la