Active Property

Microsoft Word Visual Basic

Show All

Active Property

       

Active property as it applies to the LineNumbering object.

True if line numbering is active for the specified document, section, or sections. Read/write Long.

expression.Active

expression   Required. An expression that returns a LineNumbering object.

Active property as it applies to the Selection object.

True if the selection in the specified window or pane is active. Read-only Boolean.

expression.Active

expression   Required. An expression that returns a Selection object.

Active property as it applies to the Window object.

True if the specified window is active. Read-only Boolean.

expression.Active

expression   Required. An expression that returns a Window object.

Example

As it applies to the LineNumbering object.

This example activates line numbering for the first section in the selection.

Sub CountByFive()
    With Selection.Sections(1).PageSetup.LineNumbering
        .Active = True
        .CountBy = 5
        .StartingNumber = 1
    End With
End Sub

As it applies to the Selection object.

This example splits the active window into two panes and activates the selection in the first pane, if it isn't already active.

Sub SplitWindow()
    ActiveDocument.ActiveWindow.Split = True
    If ActiveDocument.ActiveWindow.Panes(1).Selection _
            .Active = False Then
        ActiveDocument.ActiveWindow.Panes(1).Activate
    End If
End Sub

As it applies to the Window object.

This example activates the first window in the Windows collection, if the window isn't currently active.

Sub ActiveWin()
    If Windows(1).Active = False Then Windows(1).Activate
End Sub