Place the cursor in the signature (2nd-last paragraph of page 2) and run the macro SpaceBefore.
Sub SpaceBefore()
' Increase paragraph-spacing-before the first Paragraph of the selection to fill up the current page of the document
Dim prg As Paragraph
Set prg = Selection.Paragraphs(1)
Dim lngSpaceAbove As Long
lngSpaceAbove = prg.SpaceBefore
Dim lngPages As Long
lngPages = prg.Parent.Range.Information(wdActiveEndPageNumber)
While lngPages = prg.Parent.Range.Information(wdActiveEndPageNumber)
lngSpaceAbove = lngSpaceAbove + 1
prg.SpaceBefore = lngSpaceAbove
Wend
prg.SpaceBefore = lngSpaceAbove - 1
End Sub
Minutes later I decided to add some text to the document, pushing the signature paragraph over to page 3, so ...
Place the cursor in the signature (2nd-last paragraph of page 2) and run the macro DecreaseSpaceBefore.Sub DecreaseSpaceBefore()
' Decrease paragraph-spacing-before the first Paragraph of the selection to pull the current page up by one page.
' Use this after inserting extra text after running "IncreaseSpaceBefore"
Dim prg As Paragraph
Set prg = Selection.Paragraphs(1)
Dim lngSpaceAbove As Long
lngSpaceAbove = prg.SpaceBefore
Dim lngPages As Long
lngPages = prg.Parent.Range.Information(wdActiveEndPageNumber)
While lngPages = prg.Parent.Range.Information(wdActiveEndPageNumber)
lngSpaceAbove = lngSpaceAbove - 1
prg.SpaceBefore = lngSpaceAbove
Wend
End Sub
No comments:
Post a Comment