This topic has not yet been rated - Rate this topic

DocumentWindow.Selection Property

Office 2007
Returns a Selection object that represents the selection in the specified document window. Read-only.

Syntax

expression.Selection

expression   A variable that represents a DocumentWindow object.

Return Value
Selection

Example

If there's text selected in the active window, this example makes the text italic.

Visual Basic for Applications
With Application.ActiveWindow.Selection
    If .Type = ppSelectionText Then
        .TextRange.Font.Italic = True
    End If
End With



Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ