ParagraphFormat.WidowControl property (Publisher)

Sets or returns an MsoTriState constant that represents whether the first or last line of the specified paragraph can appear by itself in a text box. Read/write.

Syntax

expression.WidowControl

expression A variable that represents a ParagraphFormat object.

Return value

MsoTriState

Remarks

This option ensures that the first or last line of the specified paragraph will not appear by itself in a text frame. For example, if the last line in a specified paragraph is the first line of a widow controlled paragraph, a second line will be moved to the next text frame with it.

The WidowControl property value can be one of the MsoTriState constants declared in the Microsoft Office type library and shown in the following table.

Constant Description
msoFalse The first or last line may appear by itself in a text box.
msoTrue The first or last line will not appear by itself in a text box.

The default setting for this property is msoFalse.

Example

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