Skip to content

Latest commit

 

History

History
52 lines (31 loc) · 1.14 KB

Word.Selection.Expand.md

File metadata and controls

52 lines (31 loc) · 1.14 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
Selection.Expand method (Word)
vbawd10.chm158662785
vbawd10.chm158662785
Word.Selection.Expand
8b716453-7656-e8b8-f6b0-0dc97ef2714d
06/08/2017
medium

Selection.Expand method (Word)

Expands the specified range or selection. Returns the number of characters added to the range or selection. Long.

Syntax

expression. Expand( _Unit_ )

expression Required. A variable that represents a Selection object.

Parameters

Name Required/Optional Data type Description
Unit Optional Variant A WdUnits constant that represents the unit by which to expand the range. The default value is wdWord.

Example

This example capitalizes the first character in the selection and then expands the selection to include the entire sentence.

With Selection 
 .Characters(1).Case = wdTitleSentence 
 .Expand Unit:=wdSentence 
End With

See also

Selection Object

[!includeSupport and feedback]