ParagraphFormat.KeepLinesTogether property (Publisher)

Sets or returns an MsoTriState constant that indicates whether all lines in the specified paragraph will remain in the same text box. Read/write.

Syntax

expression.KeepLinesTogether

expression A variable that represents a ParagraphFormat object.

Return value

msoTriState

Remarks

This option ensures that there is not a text frame or column break between the lines of the specified paragraph. If the paragraphs are too large for the text frame or column, the first line will start at the top of the next text frame or column.

The default setting for this property is msoFalse.

Example

This example sets the KeepLinesTogether 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.KeepLinesTogether = 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.