ParagraphFormat.SpaceBefore property (Publisher)
Returns or sets a Variant that represents the amount of spacing (in points) before one or more paragraphs. Read/write.
Syntax
expression.SpaceBefore
expression A variable that represents a ParagraphFormat object.
Return value
Variant
Example
This example sets the spacing before and after the third paragraph in the first shape on the first page of the active publication to 6 points. This example assumes that there is at least one shape on the first page of the active publication.
Sub SetSpacingBeforeAfterParagraph()
With ActiveDocument.Pages(1).Shapes(1).TextFrame _
.TextRange.Paragraphs(3).ParagraphFormat
.SpaceBefore = 6
.SpaceAfter = 6
End With
End Sub
This example sets spacing before and after all paragraphs in the first shape on the first page of the active publication to 6 points. This example assumes that there is at least one shape on the first page of the active publication.
Sub SetSpacingBeforeAfterAllParagraph()
With ActiveDocument.Pages(1).Shapes(1).TextFrame _
.TextRange.ParagraphFormat
.SpaceBefore = 12
.SpaceAfter = 6
End With
End Sub
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.