StartIsActive Property

Microsoft Word Visual Basic

StartIsActive Property

       

True if the beginning of the selection is active. If the selection is not collapsed to an insertion point, either the beginning or the end of the selection is active. The active end of the selection moves when you call the following methods: EndKey, Extend (with the Characters argument), HomeKey, MoveDown, MoveLeft, MoveRight, and MoveUp. Read/write Boolean.

expression.StartIsActive

expression   Required. An expression that returns a Selection object.

Remarks

This property is equivalent to using the Flags property with the wdSelStartActive constant. However, using the Flags property requires binary operations, which are more complicated than using the StartIsActive property.

Example

This example extends the current selection through the next two words. To make sure that any currently selected text stays selected during the extension, the end of the selection is made active first. (For example, if the first three words of this paragraph were selected but the start of the selection were active, the MoveRight method call would simply deselect the first two words.)

With Selection
   .StartIsActive = False
   .MoveRight Unit:=wdWord, Count:=2, Extend:=wdExtend
End With

Here's the same example using the Flags property. This solution is problematic because you can only deactivate a Flags property setting by overwriting it with an unrelated value.

With Selection
   If (.Flags And wdSelStartActive) = wdSelStartActive Then _
      .Flags = wdSelReplace
      .MoveRight Unit:=wdWord, Count:=2, Extend:=wdExtend
End With

Here's the same example using the MoveEnd method, which eliminates the need to check which end of the selection is active.

With Selection
   .MoveEnd Unit:=wdWord, Count:=2
End With