Paragraph.Style property (Word)

Returns or sets the style for the specified object. Read/write Variant.

Syntax

expression.Style

expression Required. A variable that represents a 'Paragraph' object.

Remarks

To set this property, specify the local name of the style, an integer, a WdBuiltinStyle constant, or an object that represents the style.

Example

This example displays the style for each paragraph in the active document.

For Each para in ActiveDocument.Paragraphs 
 MsgBox para.Style 
Next para

This example sets alternating styles of Heading 3 and Normal for all the paragraphs in the active document.

For i = 1 To ActiveDocument.Paragraphs.Count 
 If i Mod 2 = 0 Then 
 ActiveDocument.Paragraphs(i).Style = wdStyleNormal 
 Else: ActiveDocument.Paragraphs(i).Style = wdStyleHeading3 
 End If 
Next i

See also

Paragraph Object

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.