ParagraphFormat.KeepWithNext property (Publisher)
Sets or returns an MsoTriState constant that indicates whether the following paragraph will remain in the same text box as the specified paragraph. Read/write.
Syntax
expression.KeepWithNext
expression A variable that represents a ParagraphFormat object.
Return value
MsoTriState
Remarks
The purpose of KeepWithNext is to prevent hanging headings in a document. To do so, you may set this property to msoTrue for all headings.
The default setting for this property is msoFalse.
Example
This example sets the KeepWithNext property to msoTrue for the specified ParagraphFormat object.
Dim objParaForm As ParagraphFormat
Set objParaForm = ActiveDocument.Pages(1).Shapes(1) _
.TextFrame.TextRange.Paragraphs(1).ParagraphFormat
objParaForm.KeepWithNext = msoTrue
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.