WidowControl Property

Microsoft Publisher Visual Basic

Show All Show All

WidowControl Property

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

msoCTrue
msoFalse The first or last line may appear by itself in a text box.
msoTriStateMixed
msoTriStateToggle
msoTrue The first or last line will not appear by itself in a text box.

expression.WidowControl

expression    Required. An expression that returns a ParagraphFormat object.

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 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