This documentation is archived and is not being maintained.

Backwards Property

Visual Studio .NET 2003

Sets or returns whether the search is performed backwards from the current position.

[Visual Basic .NET]
Public Property Backwards() As Boolean
[Visual Basic 6]
Property Get Backwards() As Boolean
Property Let Backwards( _
   ByVal NewValue As Boolean _
) 
[C++]
HRESULT __stdcall get_Backwards(
   /* [out, retval] */ VARIANT_BOOL* retVal
);
HRESULT __stdcall put_Backwards(
   /* [in] */ VARIANT_BOOL NewValue
);
[C#]
public bool Backwards {get; set;}
[JScript .NET]
public function get Backwards() : Boolean
public function set Backwards(
   NewValue : Boolean
)

Parameters

NewValue
Required. Indicates whether to perform the search backwards. Default value is False.

Return Value

Returns True if search is performed backwards, False if not.

Example

Sub BackwardsExample()
   Dim objTextDoc As TextDocument
   Dim objEditPt As EditPoint
   Dim iCtr As Integer
   Dim objFind As Find

   ' 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
   objFind = objTextDoc.DTE.Find

   ' Insert ten lines of text.
   For iCtr = 1 To 10
      objEditPt.Insert("This is a test." & Chr(13))
   Next iCtr

   ' Set the find options.
   objFind.Action = vsFindAction.vsFindActionReplaceAll
   objFind.Backwards = False
   objFind.FilesOfType = "*.txt"
   objFind.FindWhat = "test"
   objFind.KeepModifiedDocumentsOpen = True
   objFind.MatchCase = False
   objFind.MatchInHiddenText = False
   objFind.MatchWholeWord = True
   objFind.PatternSyntax = vsFindPatternSyntax.vsFindPatternSyntaxLiteral
   objFind.ReplaceWith = "NEW THING"
   objFind.ResultsLocation = vsFindResultsLocation.vsFindResultsNone
   objFind.SearchPath = "c:\temp"
   objFind.SearchSubfolders = False
   objFind.Target = vsFindTarget.vsFindTargetCurrentDocument
   ' Perform the Find operation.
   objFind.Execute()
End Sub

See Also

Applies To: Find Object

Show: