Rediger

Del via


Range.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 Range 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. When you return the style for a range that includes more than one style, only the first character or paragraph style is returned.

Example

This example displays the style for each character in the selection.

Note

Each element of the Characters collection is a Range object.

For Each c in Selection.Characters 
 MsgBox c.Style 
Next c

See also

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