Export (0) Print
Expand All
Cut
Run
Expand Minimize

WordLeft Method

Visual Studio .NET 2003

Moves the object the specified number of words to the left.

[Visual Basic .NET]
Public Sub WordLeft( _
   Optional ByVal Count As Integer = 1 _
) 
[Visual Basic 6]
Sub WordLeft( _
   Optional ByVal Count As Int = 1 _
) 
[C++]
HRESULT __stdcall WordLeft(
   int Count
);
[C#]
public void WordLeft(
   int Count
);
[JScript .NET]
public function WordLeft(
   Count : int
)

Parameters

Count
Optional. Specifies how many words to move the edit point to the left of its current position in the buffer.

Remarks

Moves the edit point to the left the indicated number of words. If the beginning of the document is reached before Count words, the point remains at the beginning of the document.

If the argument is negative, then WordLeft performs similarly to WordRight.

Example

Sub WordLeftExample()
   Dim objTextDoc As TextDocument
   Dim objEditPt As EditPoint, iCtr As Integer
        
   ' Create a new text file.
   DTE.ItemOperations.NewFile("General\Text File")
       
   ' Get a handle to the new document and create an EditPoint.
   objTextDoc = DTE.ActiveDocument.Object("TextDocument")
   objEditPt = objTextDoc.StartPoint.CreateEditPoint
        
   ' Insert ten lines of text.
   For iCtr = 1 To 10
     objeditpt.Insert("This is a test." & Chr(13))
   Next iCtr
       
   ' Replace the eighth word on the third line with a new word.
   objEditPt.StartOfDocument()
   objEditPt.LineDown(3)
   objEditPt.WordRight(3)
   objEditPt.Delete(4)
   objEditPt.Insert("raid")
   objEditPt.WordLeft(3)
End Sub

See Also

Applies To: EditPoint Object | EditPoint Example 1

Show:
© 2014 Microsoft